While changing game mode some items are moved out of your inventory to the 2x2 crafting grid.
Change your game mode to creative
Put a full stack of 64 items in your first hotbar slot (I tested diamonds)
Change your game mode to survival
This bug is new in this snapshot, it won't happen in 1.12