When you open your inventory and pick up an item out of an inventory slot to move it around it won't get removed when a /clear command gets triggered.
Linked issues
Comments 4
Maybe caused by the fix of MC-18627
Might also be just a cause of the great inventory rewrite of 2014, possibly intentional, but I can see how this may cause problems.
Fixed (in survival) in one of the recent snapshots. Creative still affected, but caused by another issue that's still open somewhere else on this tracker.
edit: MC-41113
That is very impractical for menus in the inventory. also it worked in previous versions of minecraft