The bug
Items in the crafting grid (inventory one or crafting table) disappear instead of being dropped when the player is marked as dead and the inventory is therefor not closed properly.
Video showing the bug in a Server: (I proved it in survival too): https://youtu.be/Z4It1Fp19C4
Affected situations
Closing the game
Being kicked from a server
Dying
It looks like the same happens when you die while having items in the crafting grid. It appears the items are moved back to your inventory, but maybe too late, after you inventory items have been dropped.