The bug
Iron golems are immune to knockback. However, they are still knocked back by explosions. In general, this is an issue with any mob with the knockback_resistance
component.
How to reproduce
Spawn an iron golem
Hit it with a sword
→ ✔ No knockback (even if the sword is enchanted with knockback)Spawn and ignite a creeper
→ ❌ After it explodes, the golem is knocked back
Comments

A similar thing happens with creative players. Even while flying it's still possible to knock back them with explosions