Have rigid body enter a planets orbit but always be able to escape it

I’m trying to create a 2D top down game where players can launch balls and it will zoom around the map and be influenced by different planets when it enters their respective field of gravity. I’m just thinking ahead here but I believe occasionally I will enter a scenario where the ball is going to be stuck in the planets field of gravity obviously bringing the game to a halt. Is there any sort of ways I could avoid that?

My idea is maybe decreasing the strength of gravity the longer the ball spends time in the field of gravity

I think you should add velocity in the opposite direction of the gravity-vector and make it biggen than the gravity (force) so you can escape the orbit.
The main problem whould be making it look natural; so maybe to keep it looking natural you could try to temporarely lower the gravity if you detect the player whants to exit the orbit. Becouse of the lower gravity you will have more control (I think) to make it look natural.