Genesis even gets the order wrong. It says light came after the Earth, which we know is wrong since the heavier elements that compose the Earth can only be formed in stars.
It's a creation myth parallel with what people knew at the time, which wasn't much.