If you simultaneously click on the buttons for selecting items in the inventory (for example, 1 and 2) and the button for discarding the item (q-default), then the icon of the item that you did not throw out will simply disappear until you click on it in the inventory itself. At the same time, the thing itself will not disappear, its designation in the form of its picture will simply disappear (it will not work in her hand). The attached video uses an unmodified version of the game.
Can confirm, there is definitely some odd things going on when pressing multiple number keys and Q simultaneously. In Survival, the inventory just gets deynced so nothing is lot, while in Creative, the item disappears completely.