Frame Challenge
It's not a ship that would find a planet, it's an observatory.
Keep Watching the Skies
Right now, we've found 4 341 planets outside our solar system, and we've only barely sent one space ship outside of same. Even with many space ships, people wouldn't be sending ships to go find planets. Even in Star Trek, stellar cartography is mostly handled by enormous telescopes.
So that's what your planet would be hiding from. An enormous space telescope, probably built a long way from the star of its solar system, gradually cataloguing all the stars in the night sky. Watching for the dips in intensity that indicate a planet, and the spectral lines indicating what its atmosphere is made of. We can do that now with space and ground-based telescopes. Any civilization that has starships is going to have much, much better telescopes that are constantly on the lookout for where their next scouting team is going to be sent.
So then that's the challenge. The pirates happen to find a planet in an as-yet unmapped part of space... 199
but the cartographers aren't sitting still. So the question is - how good are the telescopes, and how many of them are there? There are approximately 200 billion stars in the Milky Way. Assuming a Cartographic Observatory can process ten a day, it would take fifty million years to work its way through them all, and 25 million to find a particular planet at random. But if it can work through ten thousand a day, and if there are a thousand such installations... the pirates' secret planet's days are numbered.
Side Note: Space is Big
It would make sense to only fly through charted territories, so random asteroids and pirates are not as much of a problem, right?
Pirates may be a problem. Asteroids are not. Our solar system's asteroid belt is pretty dense as far as such things go in space. The average distance between any two objects in that belt is approximate 966 thousand kilometres.
There are not (indeed, cannot be) asteroid belts as dense as those pictured in Star Wars, because such a belt would aggregate into a planetoid or planet, unless it was a very, very recent phenomenon (Alderaan, for example).
So if you choose a direction at random in the sky, and fly your rocket in that direction for twenty lightyears, the odds that you hit anything of note once you leave the mess in Earth's orbit behind are astronomically (haha) low.
If you want a reason for people to take particular routes, it's best to have it associated with how you handle FTL - because asteroids, nebulae, and other space-borne objects are not a reasonable threat. 921