Hi welcome to the forum!
Goldfish are actually surprisingly difficult to keep properly, in earlier days people had success with keeping them in little bowls because the fish were tough with good quality genes and healthy fish that managed to survive in small bowls and high levels of toxins in the water - literally defying science and logic. However today goldfish (among many other common tropical fish) are bred in massive massive numbers just from harvested eggs not based on the quality of the parents which often result in low quality genes and all sorts of health problems they are also raised as fry in 100% sterile environments and then transfered to the shop where again they are kept in a near sterile environment so when you get them into a new tank and expose them to the nitrogen cycle they basically poison them selves because they are living in their own toilet.
When we say fish live in their own toilet think of it in literal terms, with all waste products there are a whole host of issues that arise. The main problem in new tanks are chemicals called ammonia and nitrite which are created by fish poo. The cycle goes like this -
Fish poo - Ammonia - Nitrite - Nitrate
Fish poo creates the ammonia then a bacteria that forms naturally in flowing water with an ammonia source eats the ammonia and creates a chemical called nitrite in a similar way we breathe in oxygen and breathe out carbon dioxide. However nitrite is still harmful to fish and can kill them but again a natural bacteria processes the nitrite into a chemical called nitrate which is quite harmless to fish which is what we need to do water changes with.
This is called the nitrogen cycle which goes on constantly in established fish tanks. In new tanks however there is no bacteria but the bacteria will grow if it has an ammonia source and a way of flowing the water - ie the filter. However while this is happening the chemical levels of ammonia and nitrite get really high and will kill fish in the water or at the very least make them ill.
The best way to get around this is whats called a fishless cycle which is where you bypass the fish poo to create the ammonia by using household ammonia so in the first few weeks of the fish tank you add a small amount of pure ammonia to grow your bacteria that will then support the fish that you add to the tank. There is a really good guide to this process in the beginners resource section.
Goldfish are very messy fish they create a lot of poo and waste and can fowl water very quickly. So within the day the fish were in there the poisonous ammonia levels would be sky high and thats what would have killed your fish. Like I say a few years ago goldfish were very tough and hardy fish but mass farming has wrecked them. Additionally its kind of a personal choice of how well you want your fish to live, the goldfish in a bowl that has survived for years is doing just that just surviving not thriving. To thrive goldfish need big big tanks or ponds to thrive to grow to their full potential and never be kept on the edge of the risk of death from the poisons they were living in. I dont want to sound like a hippy but its just kind of an ethical choice of how you keep your fish.
If the tank is quite a small one say around 50 liters or 10 gallons or smaller there are better fish to keep in it. If the tank is for your daughter I reckon the easiest thing to do would be for you to do a fishless cycle, add a small heater to the tank and have a male Siamese fighting fish. These have the long flowing fins of the goldfish but stay small and come in some incredible colours
I know its a lot to read there hope its helped!
Wills