The "/clear" command doesn't remove items held by the mouse cursor in creative mode
Please note that this issue is exclusive to creative mode.
When using the /clear command, items being selected in the inventory are not cleared.
To test this, I used a delayed command block to clear my inventory while I picked up a stack of dirt from my hotbar.