I'm not sure where you're quoting that from, but in my new international bible, it clearly states that god made the sun and the stars AFTER already creating light, day and night.
You seem to be using a purposefully adapted version to ignore that part.
How did night and day exist without any stars?
Young's Literal, both versions say basically the same thing
Here's the sequence of events over the first 4 days
1) a dark, water covered world is given rotation near a star (the Sun) - the Light caused both the spinning primordial world and its closer proximity to the Sun. It was a collision...
2) Heaven is placed amidst the waters - its something "firm" and is described as a hammered bracelet. The asteroid belt, the remains of the collision.
3) Earth is revealed from under the water and life begins - Earth is the dry land, not this planet
4) Lights appear in Earth's sky - both the Earth and its sky appear after the 1st Day Light, Day and Night. No Earth? No Earth's sky and no lights in Earth's sky. Thats why the lights appear on the 4th Day, the Earth didn't show up until the 3rd Day.
As you can see Genesis employs words like create and made quite loosely. The Earth was not created, it already existed before the 1st Day but was submerged by water and darkness. And when the Earth does appear in the story its merely revealed by gravity, water receded into Seas.
The word "made" appears in a certain context - lights that serve specific purposes - and means appointed, assigned, or given roles. They were made to serve for signs, seasons, to rule over Night and Day, etc. That means a relative hand full of lights are being referenced, not the universe.
And what does the science tell us? Our water likely formed at the asteroid belt and our oldest "rock" formed in water suggesting the world was covered by water before plate tectonics began building the landmasses and the appearance of life.