Capillary worms are another deadly parasite which peafowl often mimic gapeworm type symptoms.
You mentioned you wormed him but I would catch him and dose him down the throat for 3 days. Then repeat in 10-14 days. And keep him isolated from other birds.
Capillary worms infest the crop and the esophagus of the bird and they will gape, yawn, stretch their necks, wipe their beaks often, cough, and can develop a raspy type wheeze. They will quickly develop inflammation in the esophagus and have mucous secretions.
Poor appetite, rapid weight loss, unthrifty appearance, and anemia.
Not saying your bird does not have gapeworm, but it may be capillary worms.
A fecal will tell you for sure.
Treatment is different, as Yoda mentioned safeguard does not work well at all for gapeworm, but is best for capillary worms.
Gapeworm is best treated with Ivomec and Valbazen is also used.
If it is gapeworm ivomec given orally for peafowl over 6 months at .5 or 1/2 mL as a drench down the throat will work within 24 hours. It works fast on gapeworm as a drench.
If you do have Valbazen on hand you could use it and it will kill both gapeworm and capillary worms. A little slower for gape than ivomwc, but it will work. For a adult male we use 1 mL as a drench one time a day for 3 days.