To reproduce:
/clear
or shift-click Destroy Item slotPut an item in each of the 9 hotbar slots
Pick-block on a block that you don't have in your hotbar
You will have created a ghost item, namely the item that was pushed away from the hotbar to make space for the block. To verify this, /clear
and open your survival inventory: The item will still be there.
Also you can't find this item with
/execute if data entity @p Inventory[{id:"minecraft:item_id"}]
until you open the inventory.
In 1.16.1 and 20w29a