As has been at least hinted at more or less precisely/coherently, the moment the planet vanishes then any object actually orbiting that planet will continue moving in a straight line* in the direction they were moving when the planet disappeared.
What happens next depends on a lot of things. If they are flung towards another planet, they may get trapped in an orbit around that planet, or "slingshot" around it. They may smack straight into it. They might get flung into an orbit around the sun the planet is orbiting - assuming the planet is orbiting a sun. They may - and could be the most likely outcome - leave the solar system altogether, maybe bending round a few of the other bodies in the system on the way.
But that's objects. 801
What about ships? Well, Star Trek-y, Culture-y, or Star Wars-y ships that basically scoot about all over the place at ridiculous speed with effectively infinite fuel won't care much at all, they'll just scoot off somewhere else.
But for a more realistic ship, as you might find in <PERSON>, or The Expanse, the effect would be profound. What if their planned itinerary required refuelling at that planet and they didn't get the chance? What about an orbital shuttle or space station? Even under ideal conditions suddenly hurtling into the dark at thousands of kph with no other planet closer than a few months away, and maybe with not even enough fuel on board to "stop"** let alone figure out how to reach safety, is Bad News. And if all other craft in the same boat are similarly realistic in their limits, the chance of rescue or aid is slim even from someone fully stocked up.
And there in you might find the real drama. How to combine scarce resources - time, fuel, food, oxygen - with orbital mechanics to weave an improbable path to safety.
*Very very Straight-ish anyway. Gravitational influence from other bodies will be extremely slight at typical solar system distances.
**"Stop? Relative to what?" you cry. Yeah I know, the point is you're instantly in the situation of having a lot velocity that may well be very unhelpful. 947