Title. Logging out with an extra weapon in your hands and then logging back in makes it impossible to remove from hands.
Tried:
Dragging other items onto it
Using hotbar to select new item
Pressing red X
The only thing that works to remove it from your hands is to force it out (by using bandages or anything that would require you to drop it)