Yes, you have stated the problem well. And this is a very instructive example of why I've said that we must interpret Scripture in its *original context* as it was originally meant to be understood, because when we do that, there is no contradiction.
Genesis is only "wrong or untrue" if God intended it to be understood as a modern scientific account. But what if God never intended that?
What if God wanted to communicate *theological truth* in terms that those living in biblical times could understand? What if a modern scientific account is not something they would understand?
What if Genesis was meant to be a point by point rebuttal of Egyptian pagan creation myths? (like it gives every indication of being). What if the Hebrews enslaved in Egypt had been indoctrinated by false Egyptian pagan creation myths for 400 years? What if at Mt Sinai, God corrected this by rebutting their false indoctrination point by point? What if that rebuttal was done in such a way that (while offending our modern sensibilities) made sense to them at the time?
"But why didn't God just give them accurate scientific knowledge in doing so" (so asks the modern man/woman who values such things). What if it's not just about us in modern times who have only recently learned all we know about the universe (we didn’t even know there was such a thing as a galaxy until the early 1900s). What if such an "accurate" scientific account would have had little to no meaning to those in ancient times (the way their ancient stories have little to no value to us)? What if such an "accurate" scientific account would have made no logical sense to them (the way ancient cosmology and solid support structures "in the midst of the waters" make no sense to us)?
What if Genesis 1 gives every indication of being a point by point rebuttal against Egyptian paganism the Hebrews had been indoctrinated with---theologies that competed against the one true God Yawheh?
"The similarities in detail and structure are too close to be accidental"
What if Genesis 1 was not meant to be a modern scientific account for us, but a theological rebuttal of Egyptian paganism?
‐------------------------------------------------
*Let me give a specific example:
The modern man/woman ask, "Why didn't God give an 'accurate' scientific account in Genesis?"
Well, let's try to imagine what that would entail: on Day 4, God created the sun, moon, and stars in outer space (what's that?). The sun and stars are giant gas spheres (What is that? The sun is a flat circular disc, not a sphere) larger than the earth (how can that be when they look so small by comparison?) that emit heat, light, and radiation as a result of nuclear fusion (huh?). This nuclear fusion reaction is triggered in the center under crushing pressure and million degree heat (what's a degree?) and is sustained by balancing outward expansion with inward gravitational pull (what does that even mean?).
Do you see how meaningless that would be in an ancient world where everyone (except the Hebrews) believed the sun, moon, stars (and sky, and earth, and water) were all gods and goddesses--- supernatural deities? It would mean nothing to them, nor would such factual information help them *spiritually* in any way.
Our modern scientific account wouldn't even penetrate their psyches past "Sun" and "Moon," because they would think those were the names of the deities, not natural, NON-supernatural, physical objects. We wouldn't be able to even call them the "Sun" & "Moon," or give them any name at all, because, again, they would misunderstand and think those were the names of those gods and goddesses.
But what an impact! What a statement! If those gods were downplayed and disrespected and minimized and completely stripped of deity and devalued by not even giving them names? By simply calling them "the lesser and greater light?" What a slam! What an insult! (*just like how the plagues weren't just plagues but Yawheh's attack on the Egyptian sun God, and god of the Nile, and so on and so forth). Something we skim over today that would not have been lost on them; that would not have been missed in the culture of the time (No deity name? What? Just a lesser and greater light?)
This is but one example of the beautiful truth that Genesis is, the one true God destroying and humiliating the false gods of paganism
-------------------------------------------------
So, yes, Genesis would be wrong IF it was meant to be understood as a modern scientific factual account of things. But all the evidence we have suggests that it is not, but a point by point rebuttal of Egyptian paganism that the Hebrews would have been steeped in and indoctrinated in for 400 years. When understood in its original Ancient Near East context, Genesis makes perfect sense and is not wrong at all, but right in the timeless theological truths it communicates: there is ONE God only, all so-called pagan gods are false gods, all those things sun, moon, stars, earth, sky waters.... are not gods but created things. This one God brought order to chaos (just as the universe today ia remarkably ordered). Humans were not created to serve the gods and provide food and shelter for the gods/idols, which were incapable of feeding and taking care of l themselves, but were specially created in the image of God to be His image bearers, His royal, priestly representatives on earth.