Region: Middle Earth
Yeah, there's this whole story about Tolkien wanting in his later years to revisit LoTR and Silmarillion to ground them into less mythological roots and his vision about a spherical world was in tune with that. However, it did pose to him a great deal of trouble and it was mostly left to wishful thinking - although he did try to put some of these ideas into writing (but with the majority of them published at a later time by his son). So the most important thing to note is that these stories are unfinished.
Anyway, one of these revisions was his changing ideas regarding the creation of the sun and the moon, and the nature of the world itself, with anything that resembles flat world or other ancient concepts to be attributed to confusion and to old lore and myths passed down through generations, so they can be, at best, inaccurate. There are online resources that talk more about these concepts and debate about why they were not integrated into the bulk of his writing and what that might mean, but I am not going to dwell into that and will simply answer your question with what I know;
There is a back story behind the Sun and the Moon, although I am a bit unsure right now about that. From what I remember I believe that it was something like the Sun existed since the ancient past, and Melkor wanted to destroy it and managed to darken the Sun and so the Two Trees were created to hold the pure light of the Sun of a time before Melkor darkened it. So the Sun was from before the Two Trees (and that the Lamps were just a myth). And the Moon was either broken from the world after the conflict in the First Age or that it was created at an earlier time in order to give light in the night, since Melkor was most evil at night. And the stars always have existed but there was a shroud of darkness at night in the sky, and after the Elves awokened the shroud of darkness dissipated.
You can take this all with a grain of salt.
There are also some (and I share their opinion) that view this Tolkien's legendarium in the following way: In the past, before and during the First Age, physical and magical laws were intertwined, as in a mortal plane of existence shared the same space with a spiritual plane of existence. As the years progressed, various cataclysmic events (fights between spiritual entities in a mortal world) pushed away these two planes of existence, and actually separated them by the end of the Second Age (which coincides with the "move" of Valinor to "outer space"). So it is not so much "outer space" as actually an other plane of existence, the spiritual world. And elves have an easier "access" to this spiritual plane of existence.