It is not correct that one can ask a non-Jew to heat water to bath any child on Shabbat. It is only true in case of a real medical need that cannot be met otherwise.
R Simcha Bunim Cohen (The sanctity of Shabbos, p. 52) writes
If a child has a need that, if left unfulfilled, may lead to any
sickness, one may tell a Gentile to do a melacha - even d'oraysa -
for that need. This is only permitted, however, if the need cannot be
fulfilled in a permissible manner.
As such, the same author writes in Children in Halacha, p. 110
If a child has a rash or other skin problem that causes him
discomfort, the child is considered a choleh she'ein bo sakana.
Therefore, one may tell a gentile to do a melacha forbidden by the
Torah in order to relieve his discomfort (open hot water or boil up
So a child bath for convenience is forbidden on Shabbat and a bath for a child that suffers from a skin issue is equally permitted on both Shabbat and Yom Tov.
The reason the Sulchan Aruch in OC 511 discusses bathing on Yom Tov is that it is permitted to heat up water on Yom Tov for cooking, and once a melacha is permitted for cooking it also becomes permitted for other uses if it is shaveh lekol nefesh (important to most people). This is the case of washing hands, face and feet, but not all of one's body.
In case of children, it is permitted to bathe them when the water has been heated on Yom Tov for a permitted purpose but not to ask a non-Jew to do it for bathing only. See here for a good summary of these laws and sources.
PS. We should also clarify that the children who get the din of choleh she'ein bo sakana are children less than 3 years old in all cases and those between 3 and 9 when they are "relatively weak" (The sanctity of Shabbos, p. 52).