In this worldbuilding question, the moon is gone:
an extra-solar gas giant passed close by Earth in which the Moon was knocked from orbit to become a planet in an independent orbit, as well as sending Mercury crashing into its parent star.
So by introducing a rogue planetoid, the orbit of both the Moon and Mercury needs to be affected, with at least the former surviving the encounter.
Is this possible? If so, what are the requirements (mass, velocity, proximity)? Would it be possible for it to happen and affect the Earth minimally, so that it remains habital?