You can't plan for everything
The engine of evolution isn't foresight, or prediction. It's mistakes. Imperfect copies are an intrinsic acknowledgement of ignorance of what lies ahead. Rather than grand visions driving progress, mistakes enable adaptability to whatever lies ahead. Don't be afraid of mistakes. The world is complex, ambiguous and uncertain, but we have to act anyway. Being wrong is worth celebrating IF it means you learn. Huge external shocks, like asteroids, or the arrival of colonists from far off lands, bearing gifts of guns, germs and steel can wipe out 95% of a population. The 5% that survive can rebuild, if they keep up their mojo. If they don't get so scared they stop living. Get up. Dust off. Crack on.