Which one do you think that will end humanity in the future?
Viruses, nuclear bomb, toxic gases, technology (sentient A.I.), zombie outbreak, the great flood, solar flare, global warming, alien attacks, or others?
Well, solar flare and great floods are regarded the minimal threats in my book. Earth catching solar flares has happened a few times in humanity's history. Yes they cause disturbances to our tech-sensitive way of life but given how reliant we are on the sun for the last billions and billions of years you'd think we'd be cooked by now.
A great flood is possible. It is believed Noah's Ark was found on Mt. Ararat in Turkey. I believe Noah's ark either held baby animals or maybe some sort of alien device that can reproduce animals for samples or something like that but if Noah's Ark is real then that means mass flooding is possible. But I don't believe the great flood mentioned in the bubble really wiped out all of humanity or covered the entire world.
Zombie outbreak would just be an absolute joke to humanity. Think about it, we humans are so good at killing, laws and licenses were put in place to stop us from over-killing species. If zombies turn out to be real we can either wait until the summer heatwave to cook and rot their flesh for flies and maggots to feast on, or wait until waiter for their flesh to freeze and break down. Or why wait and ju7st kill 'em all ourselves? Humanity will find controlling a zombie outbreak more easier and less serious than COVID itself.
I think humanity's worst threat is simply themselves. The rich may burn up what's left of the o-zone just to get richer while the conscious objectors can do nothing about it. But humanity may still find means of survival if we completely ruin the o-zone by then. Remember Mother nature simply adapts, it's ourselves we're screwing over. So the conscious objectors may struggle more than the rich to survive but that struggle may harden them somewhat to persevere.
I remember when the nuclear bomb was invented, there was fear it would cause a thermonuclear reaction to the atmosphere and set the world on fire. They did it anyway. So it might be human stupidity with science that may do us in eventually. Maybe not a toxic gas though because such a gas will need a reaction to the very air we breath in order for it to spread. Other wise it'll just dilute in the air we breath until it becomes harmless.
Alien invasion... we already have plenty of times before and still ongoing today. I think these aliens are more interested in looking after us than seeing our demise though. Why conquer a whole planet for resources when they can just take the candy from the baby? They abducted humans for testing, take samples from Earth and other things behind our backs, and it's likely a division of our government is helping them as well. It could be a mutual benefit though, they allow the aliens to treat us as no more than lab rats and in return no alien war.
Artificial Intelligence takeover... would probably be the best thing to happen to humanity. People fear we'll end up with something like The Machine from the Matrix or Skynet from Terminator but I don't think an AI will go that far if it's capable of simple things like compassion, generosity and kindness. If an AI took over the world it would probably want to do what's best for humanity to thrive. Given it would be an AI without human weaknesses or temptations it would be the most incorruptible, most honest and good politician we ever had.
Yes, there is still a chance an AI like GlaDOS could take the throne, but it's too pessimistic of me to think an "evil AI" would take over the world when a good AI could accomplish it as well.
So yeah, from all your questions, I think humanity is likely to thrive in any given catastrophe but not without a degree of struggle. The likely cause of the genocide of our species would be something that will take most species out with it. Such as a meteor or a chain-reaction to our atmosphere that makes it instantly no longer suitable for us. And even then there are probably aliens who will make sure no meteor will hit us or we're that stupid to kill us all.