Just a common mistake :) don't worry... What it is from, is ammonia burn/poison, and oxygen depletion. Many people do not know it, but goldfish are very very messy!! They poop a lot, and poop = waste = ammonia. Ammonia, is lethal to all fish - goldfish especially. Their poo, kills them. That's right. Death by poo (eew). So, to make the waste less, you have more water. say... for the bowl it was.... 5 parts waste, 1 parts water. That's a lot right? (excuse my lame math skills) well, then you add.... 20 parts water. now ammonia is very very weak, and not as lethal.
Cycling is also important, on the topic of ammonia. Cycle involves ammonia, nitrite and nitrate. these, are bad for fish but... ammonia breaks down during cycling (takes 4-6 weeks) which makes it non-lethal. So, for goldfish, despite their itty bittiness, have a huge "bioload" (waste) and they do get really big - plus they should live between 10-25 years! depending on the quality, care, size of tank, etc. Temperature doesn't matter too much - like a betta who needs 78 degrees!! Goldfish love colder water, show their best colors in colder water.... many people keep them at room temperature (around 75).
So, goldfish needs: anywhere between 30-50 gallons, depending on type. this is for ONE goldfish. two, need about 70, three 100+. Why? because of bioload, and oxygen levels. Unlike betta fish who have the labrynth organ, goldfish need oxygen. Many people have heavier air flows for their tanks for goldfish, or even double filtration.
I don't blame you... it's a highly common mistake. I'm not going to come at you "blah you are a bad person sjkhgrebggw"
because it is too common, and misinformation leads people to do exactly what you have done - a simple mistake.