Ah, that's very clever! I admire your deft response!
But there was no water before the sun.
So, yes, Genesis is wrong.
You're presuming that the sun is required for liquid water. But there are
plenty of other heat sources available. Like, for instance, if the Earth had a molten center...
Interestingly, "Let there be light", came considerably before the Sun lit up (verse 1:3, the Sun in 1:16). So the first light came from elsewhere. But there wasn't day & night until there was daylight (that's one of them "DUH!" things...)
They tell me God Himself exudes quite a bit of the photonic stuff; but you pro'lly won't consider that God could be real.