Jonsie, from my experience with goldfish sometimes you get a fish that at some point is just going to have issues. Breeders usually try to cull out the weak fry and sometimes missed the weak fry last longer and make it to you. When it comes to selective breeding in goldfish there is a sort of a compaction of their organs to get a desired shape, it works for some and not for others in the same batch. Don't take it too personally. As a rule of thumb I always added a generous tablespoon of kosher salt per 5 gallons every time I did a water change. High salt treatments are usually for external issues and usually a dip or short exposure.
Goldfish eat prolifically and generate a lot of waste but they are also somewhat tolerant of these conditions compared to other fish. But they do, do better in clean water. But it seems your water parameters were in check. A well rounded diet helps goldfish, duckweed or other leafy vegetables help a lot too. And it is rather important I've found, that you want to soak your dry food as often as you can. They tend to eat fast and gulp air which can lead to problems. Sometimes bloodworms can help alleviate this. Goldfish are horrible beggars for food don't be afraid to under feed them because usually we over feed them. Don't be afraid to over filtrate ie bigger than suggested filters with goldfish the usual tank suggestions for filters are based on smaller community fish. Also I've found that Dropsy can be very common with goldfish. Also know the full growth size of the species of goldfish you keep because some of them can get rather large and quickly outgrow their tank size, when you have several of them.
Goldfish are very cool and often underrated or dismissed by some aquarium keepers. heck they even used as feeder fish. Don't get discouraged but embrace the joy of keeping goldfish. I think they're among the fishes with the most personality.