When you close your inventory or crafting menu, items from the crafting grid try to move into the inventory, stack by stack; if items in the slot of the inventory + items from one of the slots from the crafting grid exceed the stack limit, then all exiding items will either drop (if it happened in survival) or simply disappear (if in creative), even though there is plenty of space in the inventory.
- Get yourself a stack and a few items of the same type
- Put the full stack into the crafting grid
- Close the inventory/crafting menu
→ Items that exceed the stack limit will either drop (in survival) or disappear (in creative)