Unless tools of the same type have different enchantments, they cannot be switched.
To reproduce:
1. Create two of the same type of tool (ex: Two iron pickaxes)
2. Use durability on one of them so you can see the difference between them
3. Pick one of them up with your mouse
4. While holding the first tool, try to pick up the second tool
Duplicate of MC-674 , please use the search function to see if your bug has already been submitted. Currently over 30% of tickets are being closed as duplicate.