The bug
Zombie horses seem to have two conflicting goals: leaving water, and entering water when on fire. The sunlight sets the horse on fire, so it pathfinds to water. When it’s extinguished, it then chooses to leave the water, getting set back on fire again. This repeats until the mob dies.
How to reproduce
Spawn a zombie horse in daylight near a river
Watch its actions over the next few moments
Expected results
It should get set on fire, move to water, and stay there
Observed results
It gets set on fire, moves to water, then immediately moves back out and repeats
Notes
I’ve attached a video with the GOAL_SELECTOR
and PATHFINDING
renderers enabled. I used a baby horse, since adult horses of all kinds have trouble making it to water (they tend to stop at the edge – this is reported in MC-115396 in the “additional mobs” section). Other mobs like skeletons that burn in daylight seek out water and stay there.