This only applies to a SECOND PRIMARY weapon. You must have a weapon on your back and the weapon in your hands must NOT occupy space in your inventory.
1. All inventory full, including back slots.
2. Have another rifle or shotgun in your hands.
3. Use the hot bar to switch to your melee weapon.
4. The item should be transported to it's last location on the ground.