Answering your question in the details - I think humans with technology would survive everything that the solar system is likely to throw at us in near future. At least of things we know about. And - that is to say - at least some humans, since you are asking about extinction.
If the dinosaurs had had submarines able to survive under the sea for months on end - easily able to survive the few hours of the initial firestorm - and seed banks deep underground to reseed the Earth, and ability to dig deep underground caves and equip them with food to last for years - and technology to generate artificial light and grow crops with artificial lighting during the following "global impact winters" then at least a few would have survived the extinction event I'm sure.
As for long term though - we've only existed as humans for a few hundred thousand years Human evolution
And - 4 to 6 million years ago we diverged from the Chimpanzees. And from gibbons 15 - 20 million years ago - and back at the time of dinosaurs our ancestors were tiny mammals.
That's just a blink in the geological record. So long term - unless our technology lasts for millions of years and for some reason we use technology to preserve us as C20 humans genetically - then we will evolve into new species. And other species on Earth will also evolve.
And we might as easily become less intelligent - not "de-evolve" really - just evolve further and lose our intelligence if it is no longer needed (even maybe because machines do all the work for us).
And other species could become more intelligent. Or we stay the same - but they evolve further and become more intelligent than us - things like parrots, octopuses, dogs etc.
We might remain the only intelligent species on Earth for a comparatively short time - or only technological species - hard to say how "intelligent" e.g. whales and dolphins and giant squid are.
But we might lose our technology and other species become the technological one.
So - Earth does not belong to us in that sense as in that we are likely to be the ones who are still here a billion years from now. Possibly there might be species descended from us who exist then, and possibly some of them may be intelligent and technological. Others, also descended from us, may be non technological.
E.g. one science fiction story I remember from long ago explored this idea - I can't remember details - but humans that somehow got seeded onto a remote planet with hardly any other creatures on the planet. Over a long period of time, human offspring diversified to fill all the niches on the planet - only some of them retaining intelligence. As after all intelligence is not such a great asset if you spend your life eating leaves like a koala bear, say, or hanging upside down from trees as a human descended sloth.
That might seem a bit of a "horror" story - but - I don't really see that it is. Just need to look closely at the animals and birds around us to see - especially if you look at their skeletons in a museum - that we are all pretty closely related anyway. Does it make any difference if in some future they are all descended from human ancestors (as might happen for instance, a few million years from now, if our descendants had a giant impact, and the survivors hadn't managed to save many large mammals, just plants and smaller creatures)?
So could be like that. Or could be - that you have lots of intelligent species. Or we could "uplift" other intelligent species on Earth.
So - when you look at it that way - we only have this Earth, as humans, for a very short time on the geological timescale.