
He flooded the Earth not only because the people are becoming wicked, but because the Nephilim, the group of fallen angels who followed Satan, started sleeping with human women and corrupted the children of man, so he had to take care of that before humanity’s future offspring becomes completely hybridized
Also he did not wipe out the world again as a persistent cycle like lab rats in a failed experiment. He has mercy but at times he will judge. The late Bronze Age collapse is the closest example of the flood where whole cultures vanished when their alphabet. The medieval dark ages pales in comparison.
The point is that he tells his people they will not go extinct but at the same time are not immune to judgement or ordeal. Things like that happen to show God exists and his order. Without that, the Tower of Babel would have had one culture and one language of elites controlling people away from God. He doesn’t allow that which is why the late Bronze Age collapsed and Egypt became a vassal of Rome as a consequence later on.
Also God allowed Egypt to rise to keep other kingdoms from achieving dominion. Egypt how very suffered God’s wrath because they too cannot achieve dominion. God keeps a one world government from forming or a palace controlling the culture and language of people. People are free to choose to follow God or not but no ruler can bar people from accessing God completely.
Adam and Eve had everything they needed and after eating the fruit they had imperfection rein into the world and their lifespan was cut short. Abraham was tested and God did not want a human sacrifice. God allows ordeals and even lets nations like Egypt to gain in power for an ordeal. Jesus asked the disciples to walk forward over water and their common sense told them not to but all the miracles around them told them to have faith. Even when they failed Jesus was there hold their hand.