When you hold right click and while having an item in your cursor, then move around it over the same item without letting go, the item will visually disappear. It will come back after you let go though.
Steps to reproduce
Get two separate stacks of the same item in your inventory
Click one of them to hold them
Start holding right-click while hovering over the other stack
-> ❌ The other stack visually disappears until you either let go of right click or hover over a different slot.
Can confirm in 1.17.1.