There are probably many ‘rogue’ planets not attached to a particular star. Just wandering around the galaxy like any other debris leftover from novas and supernovas.
That’s the premise for the novel and movie “When Worlds Collide”..............That is one movie I’d like to see re-made with modern technology!................
I would think that, eventually, they would get pulled into a solar system at some point. Maybe I’m wrong. But if they did that’s definitely when “worlds collide”. Would kinda suck if a rogue planet tried to cut in line between earth and Venus.