If you open inventory right after placing or removing a block (while the sound was still playing), it will be replayed once you close the inventory.
Works both in Survival and Creative.
What I expected to happen was...:
I expected no sound to be played after closing inventory.
What actually happened was...:
A sound is played of the last action (placing/removing block) after closing inventory window.
Steps to Reproduce:
1. Place or remove a block and immediately open inventory
2. Close inventory and listen