The Iron Golem death sound will fail to be played when the mob is attacked and killed by the player through melee attacks while it is underground with just its head sticking out.
Steps to reproduce the problem
Adjust the volume slider for "Friendly Creatures" to 100%.
Desynchronize the Iron Golem so that its torso gets squeezed between the smooth stone blocks while its head remains visible above the ground.
Make sure that the golem is not being damaged by suffocation (head is safe from any solid blocks).
Strike the head repeatedly with a Netherite Sword.
Expected result
Death sound effect is played due to the exposure of the head to air.
Actual result
The golem dies without any death sound effects and only drops its loot.
Can’t reproduce in 26.4 Snapshot 5. With just the head free the death sound plays normally for me. It only goes silent if the last hit comes right after another one, see MC-312906.