... when you actually cannot jump out of the system you bought the ship in.
Yes, this actually happened to me. Can't remember where.
Fortunately, I was able to supercruise within the system to a station that sold a (slightly) better FSD.
I did that once, when I unlocked the Fed Gunship ages ago. Flew straight to the nearest system that sold them, kitted it all out (having part exchanged my ASP for it I believe), then realised even with the biggest FSD available at that station I was unable to even leave the system.
So stranded in the system, and having lost my ASP, I had to just buy whatever ship was available with a jump range large enough to leave (I think a Cobra) and then go and buy it somewhere else...
This was before ship transfer too, I had to part ex the Gunship for the Cobra at a loss to achieve this. Man I felt stupid.
