- Nearby supernovae
- Gamma ray bursts (eg from a neutron star that happens to be pointing directly at us and is sufficiently close)
- Large icy or rocky bodies hitting the planet
- Coronal mass ejections
- In about 1.6 billion years the increasing Solar output will make Earth uninhabitable
- In about 4 billion years the dying Sun will expand and essentially swallow the Earth, which will be long dead anyway
And here's a list of terretstial civilization killers:
- Supervolcanoes
- Climate change
- Global war
- Disease
- Ice ages
There are also others that we don't know how disruptive they will be other than probably super disruptive like the magnetic poles flipping (yes, this has happened at least 30 times).
My point here is that living on Earth is living on borrowed time. To survive in the really long term, we are going to have do something pretty drastic. Whatever we do (eg interstellar travel, moving the EArth--yes, this is possible) will require such massive energy expenditure that IMHO the only path forward will be to build a Dyson Swarm.
I'm also not yet convinced we can think of the time scales required to avoid our own destruction but at least, for a brief period of time, we will have created an awful lot of shareholder value. Over sufficiently long time periods, all of these turn from an "if" into a "when".