The bug
The ability for note blocks to play the sounds of mobs if the mob's head is placed on top is an experimental feature which requires a data pack to be present in the world to experience. Despite this, note blocks which play mob sounds can still be obtained in non-experimental worlds.
How to reproduce
A debug stick is the easiest way to reproduce this, as it can set the note block's instrument accordingly. However, debug stick issues are not supported. Another method exists, however, which does not require it:
Create or enter a world WITHOUT the 1.20 data pack
Execute the command
/give @s minecraft:note_block{BlockStateTag:{instrument:"creeper"}}
Place the note block
Right click on it
Expected results
The note block would not play creeper sounds when right clicked, as note blocks playing creeper sounds is an experimental feature which should not be available on non-experimental worlds.
Actual results
It does.
After discussing with the platform team it was decided that this is a deliberate corner case and we will not fix it.
The player intentionally chose to bypass version lock and this is not part of normal gameplay.