If you use a command block to summon an xp orb in an enclosed space, if it is in your pickup range, it will look like you collected it but you didn't.
Steps to reproduce:
1. Dig a 3-block deep 1x1 hole.
2. Place a cmd block in the hole.
3. Set the command to "summon minecraft:xp_orb ~ ~1 ~"
4.Fill in the top block of the hole, leaving a block of air above the cmd block.
5. Power the cmd block.
6. You will be shown the pickup animation, but you will not pick it up.
Related issues
Comments

Thank you for your report!
However, this issue is a Duplicate of MC-460.
It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki