There was "light" before the sun and moon were created. Read it carefully again and you see how it's worded.
And .. if there was "light" then the sun and moon were only created for our benefit - because God is light and life.
Certainly there is light apart from that made by our sun. (The moon is actually a reflection, I'm sure you know.)
The point is that the plants and vegetation on planet earth needs light (energy) from our particular sun in order to be viable, does it not?
Of course God could make anything grow and survive with or without the sun.
But if He changes the laws of physics all the time at every whim, then it is useless talking about any historical or geological events because it could always be said that God simply changed the Physics of the Universe on that particular day, and thus all measurements we would take today would be distorted and useless.