When placing a block you are partitially standing in, the block despawns right again. This is as intended, but the block doesn't return to your inventory.
Steps to reproduce:
1. Build the following structure:
A A P a A
A A P B B
B B B B B
(*B*lock, *A*ir, *P*layer)
2. Go to the block as near as you can
2. Go to survival mode
3. Place a block at position a
4. The block disappears from your inventory
Related issues
Comments


I have reproduced it a few times, but indeed a duplicate
Dupe of MC-95720 (though, I can't reproduce your case)