Temperature shock is indeed a major cause of "flipover", most commonly known as "swim bladder disorder". The temperature of the new water should always be the same temperature as the old water. Sometimes the swim bladder heals after such a shock, sometimes not. You just have to wait and see. Be sure the temperature is the same from now on. Also, if you are changing more than 25% each time, make smaller more frequent changes instead. All fish need a 25% change at least once a week, especially messy guys such as goldfish. It's just a shock to them to have more than 25% new water at one time. Goldfish also need an adequate size tank. Small tank size and lack of exercise can cause swim bladder failure too. Goldfish need a minimum of 10 gallons per fish with a good filter. They are very messy guys that pollute their water very quickly and it causes chronic ammonia poisoning. Chronically high ammonia levels can cause all kinds of problems for fish. It burns their gills and causes irritation and sometimes burns on the skin. It weakens the immune system too. Constipation is another issue that aggravates swim bladder problems. Goldfish are mostly vegetarians and the dried foods we buy have too much protein and not enough fiber. Feed him cooked peeled green peas broken into little chunks at least 3 times a week. It may help him recover. Also feed cucumber slices, cooked squash slices, romaine lettuce pieces, cooked shredded carrots, and cooked green beans. The goldfish diet should be at least 40% veggies so they get enough fiber. They can nibble on the veggies over several hours because it doesn't rot like regular dried food does. They like to graze on them that way anyway. It's what they would do if they were in a wild environment. Nibble the day away. Lastly, a common cause of failed swim bladder is genetic deformity. Fancy goldfish with rounded body shapes sometimes can't grow long enough for their swim bladder to work properly. It gets worse as they grow larger. The swim bladder has two "lobes" that are connected by ducts. The lobes are compressed together so the ducts between them cannot open and close to allow the swim bladder work properly. I hope he feels better soon...
At Your Service;