Strictly from PHB, you can't do that
There isn't exactly a "Free Action" in 5e. The concept is presented, though, in PHB p. 190.
You can also interact with one object or feature of the
environment for free, during either your move or your
action. For example, you could open a door during your
move as you stride toward a foe, or you could draw your
weapon as part of the same action you use to attack.
If you want to interact with a second object, you need
to use your action. Some magic items and other special
objects always require an action to use, as stated
in their descriptions.
Basically, "Object Interaction" is a "Free Action", which you have already used to drop your rapier.
Although is says "interact with a second object", it's implied that interacting with the same object again later also needs an action.
From Devs' twitter, though... You can
Ok, from the comments. Crawford states you can drop the weapon at absolutely no cost, it seems (meaning you didn't actually use your "Object Interaction").
But then Mearls goes further: he states you can Sheathe, Draw and Attack at the same turn. (Honestly this is how I've been ruling it for long, hence I'm not used to the drop shenanigan).
So you don't even need to drop it, you can just sheathe it and then draw it again. Although Mearls' tweet is more about switching weapons, I don't see why doing it for the same weapon would be any harder or take any longer.
Everything else is fine.