I noticed they sometimes attack corpses, or charmed creatures that are now on their side - causing the charm to break.
This happens when their target was killed or charmed during the same general round.
Seemingly the target was determined at some earlier point (at the start of the round, maybe?) and the AI is not able to switch from that target !
I think that the AI should decide targets at the beginning of each individual turn...
Edited by Cherudek, 10 February 2019 - 07:34 AM.