Here's how the Earth could theoretically leave the solar system.
Could Earth ever leave our solar system? : Read more
Could Earth ever leave our solar system? : Read more
From https://en.wikipedia.org/wiki/Gliese_710 :
"Gliese 710 currently is 62.3 light-years (19.1 parsecs) from Earth in the constellation Serpens and has a below naked-eye visual magnitude of 9.69." "New calculations based on Gaia DR3 data confirm previous estimates and further reduce the associated uncertainty: minimum approach distance of 0.052±0.002 pc (10635±500 au), 1.29±0.02 Ma into the future.[18] " "Gliese 710 has the potential to perturb the Oort cloud in the outer Solar System, exerting enough force to send showers of comets into the inner Solar System for millions of years, triggering visibility of about ten naked-eye comets per year,[12] and possibly causing an impact event. " "The effects of such an encounter on the orbit of the Pluto–Charon system (and therefore, on the classical trans-Neptunian belt) are negligible, but Gliese 710 will traverse the outer Oort cloud (inside 100,000 AU or 0.48 pc) and reach the outskirts of the inner Oort cloud (inward of 20,000 AU). "