having a stack of any item "on the mouse" and left-clicking on another not-fully-stacked slot of this item in an chest, they exchange.
BUT doing this the other way round, left-clicking on a stack with a number less than 64 doesn´t give you the stack in the hand.
Works as intended.
This has been since ... ever.
You don't swap the item stacks, you fill up the clicked item stack with the items in your hand.