It has been occasionally mentioned on this forum how the Flood stories (J,P) interrupt the flow of the narrative of J (conventional name for primary narrative source for the Primeval History) and create plot holes.
Note how the removal of the Flood stories leaves an unbroken narrative:
28 When Lamech had lived 182 years, he had a son. 29 He named him Noah[c] and said, “He will comfort us in the labor and painful toil of our hands caused by the ground the Lord has cursed.” 30 After Noah was born, Lamech lived 595 years and had other sons and daughters. 31 Altogether, Lamech lived a total of 777 years, and then he died.
32 After Noah was 500 years old, he became the father of Shem, Ham and Japheth.
.................................................Flood.................................................
19 These were the three sons of Noah, and from them came the people who were scattered over the whole earth.
20 Noah, a man of the soil, proceeded[a] to plant a vineyard.
Storylines involving Nephilim, which ought to have ended in the Flood, continue through till the conquest stories. Similarly, the infamous Jabel and Jubal ( https://www.jehovahs-witness.com/topic/5926835157204992/jabal-jubal-tubal-song-sword) who were described as the 'Fathers of all who raise livestock or play instruments', an odd description of a dead-end genealogy.
A number of scholars have concluded Noah in the original J source was an exceptional worshiper of Yahweh who appeased Yahweh, resulting in the ending of the agricultural curse of famine from Adam. A few of the key elements that reveal the original form of the source material are:
Gen 3:
17 To Adam he said, “Because you listened to your wife and ate fruit from the tree about which I commanded you, ‘You must not eat from it,’ “Cursed is the ground because of you; through painful toil you will eat food from it all the days of your life
Gen 5:
28 When Lamech had lived 182 years, he had a son. 29 He named him Noah (comfort) and said, “He will comfort us in the labor and painful toil of our hands caused by the ground the Lord has cursed.”
Consistently in the OT, a curse on the land/ground involves famine and drought, aka. a lack of rain.
Gen 6:But Noah found favor in the eyes of the LORD.
Gen 8: And the Lord God smelled a smell of sweetness, and the Lord God having considered, said, I will not any more curse the earth, because of the works of men, because the imagination of man is intently bent upon evil things from his youth...All the days of the earth, seed and harvest, cold and heat, summer and spring, (agricultural norms) shall not cease by day or night. (LXX) "for all time" (SP)
Gen 9: Noah was a "man of the land" and planted a vineyard (symbol of agricultural prosperity)
It would seem the popularity of the Babylonian flood epic inspired parallel, yet unique, Hebrew versions (P and J) of a flood story in which the hero was Noah, the man who was formerly a 'man of the land' whose worship of Yahweh ended the curse of the land. These flood stories were merged into the existing J narrative creating the odd readings and plot holes we now have. It is conjectured that in the original story the curse's lifting resulted in rain (40 days?) and this lent to the placement and choice of Noah as the flood hero. Maybe the way he was described as a uniquely righteous man lent to the choice.
There is a lot more to consider on this topic, so I've provided a couple links to excellent work.