The topic actually is cosmology and time etc. The issue is whether the idea that light from the stars got here right away because earth was here first, as well as that the heavens were stretched out at some time. If that was after the stars were put there, that could help explain why they now are so far. You seem to be thinking biblical cosmology involves something else than the bible
Biblical cosmology is important, because it provides insight into historical context. In the historical ancient Israelite context of the day, it was common for both earth, and the stars/sun/ and moon to all collectively exist before God began creating.
That's the point. And that's why you have light before God created the sun. The sun was already there. God simply had not yet created it (ex materia).
Genesis 1:12, 14-16 NRSVUE
[12] The earth brought forth vegetation: plants yielding seed of every kind and trees of every kind bearing fruit with the seed in it. And God saw that it was good.
[14] And God said, “Let there be lights in the dome of the sky to separate the day from the night, and let them be for signs and for seasons and for days and years, [15] and let them be lights in the dome of the sky to give light upon the earth.” And it was so. [16] God made the two great lights—the greater light to rule the day and the lesser light to rule the night—and the stars.
And if you look at the text, it doesn't say that God created the sun and it appeared out of nothing. Rather it says that God created the sun to do something. To rule. To be for seasons etc. to separate etc.
Like creating a teenager to play football. Or in English we might think of it as making a boy into a man or manking a boy into a football player by giving him a helmet and bringing him forth onto the football field. You are creating a football player to do something, to play football.
creating a football player does not mean making a football player appear out of thin air. It's about meaning and purpose and design etc.
That's why the very first verse above says that the earth "brought forth" vegetation. It's God making these things to do things. It's not God making things in the sense that they just appear out of nothing.
1:1 When heaven had been separated from the earth, the distant trusty twin,
1:2 (And) the mother of the goddesses had been brought into being; When the earth had been brought forth (and) the earth had been fashioned; When the destinies of heaven and earth had been fixed; (When) trench and canal had been given (their) right courses, (And) the banks of the Tigris and Euphrates had been established
1:3 (Then) Anu, Enlil, Šamaš, (and) Ea, the great gods, (And) the Anunnaki, the great gods, Seated themselves in the exalted sanctuary and recounted among themselves what had been created.
You see it in other ancient near east creation texts as well. See above. Fashioning as in, molding or shaping or defining, making etc.
1:1 When on high heaven was not named, and the earth, beneath a name did not bear –
1:2. primeval Apsu [fresh water] was their progenitor, life-giving Tiamat [salt water], the bearer of all; their waters together they mingled, no canebrake yet formed, no marsh discoverable – when of the gods none had appeared, names were not borne, destinies not decided,
1:3. the gods were given shape within them, Lah̬mu and Lah̬amu made to appear, names they bore.
Naming (like Adam named animals) being born, not yet formed, names, destinies, given shape etc.
Consider this text in comparison to Genesis 1:1. And you'll see, it's just the way that ancient texts begin. They begin with formless material, then God steps in and makes them.
Or here is another, Genesis
2:
4 When the Lord God created earth and heaven—
5 Now no plant of the field was yet in the earth and no herb of the field had yet to grow, since the Lord God had not caused it to rain upon the earth and there was no man to work the ground 6 (but a mist went up from the earth and watered the whole face of the ground)—
7 The Lord God formed man from dust of the ground….
Formed. Growth. Watering the ground etc.
These literary introductions are styled in a way in which verse 2 extrapolates and clarifies on the nature of verse 1.
Genesis 1:1-3 NRSVUE
[1] When God began to create the heavens and the earth,
[2] the earth was complete chaos, and darkness covered the face of the deep, while a wind from God swept over the face of the waters.
[3] Then God said, “Let there be light,” and there was light.
It doesn't say "when heaven and earth appeared out of nothing". It says "when God began to create".