You can duplicate certain items when try to craft a second recipe that you don't have items for.
Example better explained:
Having all recipes, in survival:
1º: /give @p minecraft:leather 4
2º: Then right-click on crafting table.
3º: Shift-Click on "Leather boots" recipe.
4º: Choose another recipe that you don't have items for, like "Diamond boots"
And repeat steps 3 and 4 couple times until you realize that you have more leather than 4.
It may be related to items being on crafting grid but showed on inventory when you select "Diamond boots". (They are not in the inventory, they are still on crafting grid)
Steps: 1º, 2º, 3º, 4º and then click on crafting grid over a "ghost item" and you will catch leather, or try to click on leather and it will dissapear and will come back to the crafting grid.