not a bug. dont impale your own guys. thats kinda a key thing if your in battle.
Also dont shoot a fireball at them, or target that single enemy surrounded by your own guys with a catapult.
Couldnt resist. sorry.
Speaking of... The AI need to know about the catapult thing also. They help me out more than they hurt by wiping out the guys around me.