If you open your inventory and then hold an item, for example a diamond, with your mouse (when you want to move the item in your inventory you can grab it with your mouse to move it)...
If you do
/clear @a while a player is holding an item with their mouse, the item the player is holding doesn't get removed. I also tried to do
/kill @e[type=minecraft:item] but the item still doesn't get removed.
Is removing the item even possible?
I'm playing in 1.16 (snapshot 20w22a)