Sounds like bad water quality to me.
How many goldfish they are massive waste producers and need 20 gallons alone for the first one, then 10 gallons for every other goldfish added.
They all so need double the filter of the tank in gallons,
What are your water stats in ammonia,nitrite, nitrate, and ph.
Gasping and swollen gills is due to bad water quality.