Invulnerable entities are hurt by non-melee damage from creative players
The bug
Entities with the Invulnerable tag will still take damage from TNT and splash potions of harming. This is because players in creative mode are able to damage invulnerable entities, and the game remembers that the TNT was ignited/potion was thrown by a creative player.