Telling stories in episodes over a long period of time regularly leads to continuity errors. The Bible is no exception.
One that was drawn to my attention recently is the mention of kosher or clean animals in the flood story in Genesis. Genesis 7:2 is the first reference to clean animals, and it is made without explanation. The author and readers take it for granted to such an extent that they don’t even notice that a detail is being introduced into the story that required explanation – for Noah, if not for them.
If we didn’t know that notions of clean and unclean food predate the flood story in its present form, we might consider the Book of Leviticus to be what in television is known as “retconning” – something introduced later in a series to address an earlier discrepancy or puzzle.
But that still wouldn’t solve the problem. Noah didn’t have access to that book.
And so presumably at some point someone will need to introduce a time travel plot twist to finally explain how Noah could know what animals were kosher.