As I recall, the official JW doctrine on Genesis chapter 1 is that it details the order of creation "from the perspective of an observer on the earth". I have no idea which orifice they pulled that one from, but there you go.
So, based on their tortured reasoning, the sun was created "in the beginning" at Genesis 1:1. Its light came through to the earth, but the earth was covered by thick clouds 100% of the time over 100% of the surface, so an "observer on the earth" would never have perceived the yellow ball in the sky providing the light. But the light would have been sufficient for the plants.
Afterward, the teaching goes, God "thinned out" the cloud cover enough so that our mythical "observer on the earth" could perceive the yellow ball "from his perspective".
The "water canopy" that supplied the water for the global deluge of Genesis chapter 6 is mixed up in there as well, at some point.
Please, please, I know this defies about a hundred laws of physics, and things didn't really happen this way. I'm just saying what the JW explanation is, which works well enough on their adherents who are routinely counseled against reading information contrary to JW positions.