Here is how to recreate the issue.
1) Be in survival mode.
2) Fill up all your inventory except 8 slots. These items should not include sand AND gunpowder.
3) Place a crafting table.
4) Throw one stack of gunpowder to the ground right next to the crafting table.
5) Get 4 stacks of sand and 4 stacks of gunpowder on the remaining inventory slots.
6) Go right next to the crafting table where you can pick up the gunpowder from the ground.
7) Use the crafting table and shift left-click to TNT recipe. It places items worth 51 TNT.
8) Shift left-click on the TNT again without crafting the previous 51. It tries to place 64 but fails and one stack of gunpowder is lost.
Thank you for your report!
We're tracking this issue as MC-147729, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki