The bug
Some mobs don't try to get into the water when they are on fire (even if for example hostile mobs don't have any player around them or that player is in creative mode).
List of these mobs:
Creeper
Endermite
Evoker
Ocelot
Zombie Villager
Ravager
Spider
Iron Golem
Piglin
Axolotl
Villager
Cat
Panda
Hoglin
Turtle
Silverfish
Vindicator
Wolf
Zombie
Additional mobs that try to get into the water, but seem to underestimate their hitboxes:
Donkey
Horse
Goat
Cow
How to reproduce
Spawn one of the mobs on this list near water.
Set them on fire with flint and steel.
See how they don't try to get into the water.
Linked issues
is duplicated by
relates to
Comments

Can confirm for MC 1.12.1.

Confirmed for 1.13.1.

Affects 20w29a except for skeletons
Can confirm in 21w06a.

Requesting that the Mojang Priority is updated to Important as the duplicate of this report (MC-211826)'s Mojang Priority was set to important before being marked as a duplicate

Can confirm for 21w18a

Can confirm in 1.17.1.

Also affects drowned when they are far enough away from water.

Can confirm in 21w37a. Agreed that the Mojang Priority should be set to Important per MC-211826.

Can confirm in 21w38a.

Can confirm in 21w42a.

Also affects goats (MC-223917).

Can confirm in 21w44a.

Still in 1.18 Pre-1, and also affects Goats

In 22w05a
Can confirm in 1.18.2.

Confirmed in 24w45a
In 1.12 this appears to be one class (
net.minecraft.entity.ai.EntityAIPanic
) which also handles panic when being attacked, therefore the class needs to be split since monsters are supposed to fight back when attacked.