You'll see, drawn around all planets, stars and larger bodies, a green circle making a "bubble" around the object in question.
Flying inside this bubble will disrupt your frame shift drive and it will cause you to dropout of supercruise, into normal flight. Sounds like this is what's happening. It's kind of a "safety" feature to avoid flying into a planet
Best way to avoid it, is simply not to fly into the green bubble... however, if you do end up doing so (I've done it plenty of times myself

), wait a little while for your frameshift drive to cool down, then engage it again... you will be asked to follow the escape vector... simply steer the ship to align with the escape vector (same as you would with a star if jumping to hyperspace), and hit full throttle... you will reenter supercruise and be able to fly quickly away from the planet.
Then you just have to circumnavigate the planet till your chosen star is no longer eclipsed by the planet, or the green bubble.