Using the number keys to switch two slots in your hotbar and then opening any chest causes one of the slots to turn into the other one. (only in creative)
Steps to reproduce:
1. Go into creative mode
2. put an item in your first hotbar slot
3. put a different item in slot number 2
4. Hover over the second slot and press 1 to make them switch places. (while you're inventory is open, doesn't work in the survival tab, use any of the others)
5. open a chest
The slots should know have the same items.