Under the guidance of Johnny Vindicator, the ravager and witch attack themselves
Very simple steps to reproduce:
/summon minecraft:vindicator ~ ~1 ~ {PatrolLeader:1b,Patrolling:1b,Johnny:1b}
summon a Ravager next to they
Observe the phenomenon. You should now see the Ravager starting to attack itself.
Replace the Ravager in the above process with a Witch, and you can observe the Witch attacking itself, but the witch will only use healing potions and regeneration potions when attacking herself.
Environment
Windows11 22H2(22621.3155)
Java 17.0.8
It's haven't resolved and can confirm in 1.21.5