When you're setting an item inside a slot of a chest/barrel/minecart and spam clicking it, you will sometimes get more items than you should
Reproduce
1) place a barrel with a command block 2 block above it
2) put this command in the command block:
"/data merge block ~ ~-2 ~ {Items:[
{Slot:13b,id:"apple",Count:1b}
]}"
3) put it on "repeat" and "always active"
4) start shift spam clicking the apple while counting how many time you clicked
5) check if obtained amount = counted clicks (it's not)
Provide a screenshot of your game with the F3 debug screen enabled.