Summary: Selling a stack at a time only pays you for 19 of the 20, while selling 1 at a time sells all 20 for the stated price.  This is item-specific and does NOT apply to all items in the game.
Repro steps
- Put all money in bank
- Remove 1 gold from bank
- Visit merchant who sells unlimited items that cost 5 copper each
- Buy a stack for 1 gold
- Ask merchant what they'll give you to rebuy.
- In case of most items it is less than the 5 copper.
- In case of some items it is exactly 5 copper (same as purchase price).
- Sell 1 at a time (control-Click the sell button).  You receive 5 copper per item.  Selling all 20 one at a time gets you entire 1 gold back.
- Buy a stack for 1 gold total.  You should now have 20 items and 0 money.
- Shift-click to sell the entire stack at once.
Expected result:-  Game text tells you that you receive 1 gold for the stack.
-  You receive 1 gold for the stack.
Actual result:-  Game text tells you that you receive 1 gold for the stack.
-  You receive 9 silver 5 copper for the stack.
Testing with fishing bait and other small unlimited items.  Results vary depending on what item.