If you hold a stack of something you got reserved slots (in the inventory, not hotbar) for, and no more than fit into those slots, the first time you Q you get that error. The second keypress works and puts the stack back into the reserved slot in the inventory.
https://imgur.com/a/vvKPZpg
Sorry in advance if this is a duplicate. No time to check