I placed a fence gate onto a cobblestone wall just as a sheep walked over my crosshair. The gate did not place, but it still disappeared from my inventory. It was not invisible or anything, it did not go into my inventory or anything. It just disappeared. So it's like the game "ate" my fence gate.
Related issues
Comments

Thank you for your report!
We're tracking this issue in MC-163637, 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 in the future to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
Are you on a server?
Could you attach a video of it happening (with the F3 screen enabled)?