Steps to recreate:
1) With an empty inventory, open a large chest full of stacks of iron ingots.
2) Click one stack of iron ingots, then shift+double-click another stack of iron ingots. Your inventory should fill with stacks of iron ingots.
3) Open a crafting table.
4) Click a stack of iron ingots from your inventory, then shift+double-click a second stack of iron ingots from your inventory. The crafting grid should fill with stacks of iron ingots.
5) Shift+click the iron block from the crafting grid output to move a stack of iron blocks to your inventory.
6) Continue repeating steps 4-5 until all iron ingots are consumed (should result in 4 stacks of iron blocks).
I typically encounter this issue when crafting iron blocks in this method after I already have at least four stacks of iron blocks already in my inventory, though I have also encountered it with fewer than four stacks of iron blocks already in my inventory.
I thought it might be caused by failing to release shift after shift+clicking the iron block output before shift+double-clicking the next stack of iron ingots, or by simply moving through the clicks too quickly, but the issue still occurs even when I make sure to release shift or even delay for a few seconds between crafting attempts.
I was able to duplicate the issue in a single-player world in Creative mode (eliminating multiplayer/server lag as a potential factor). Here is a recording: https://youtu.be/0o3e6AYiXcQ
Edit: I just confirmed it also affects gold ingots/blocks and gold nuggets/ingots. I think it's reasonable to assume that it would affect all relevant blocks and items.
Still an issue in 1.17.1