I've seen some similar stuff, mostly during seiges, where units get into a state - maybe it's when their formation is too wide for their eventual location or something... I did notice some strange behaviour from my calvalry when chasing some routing infantry - instead of attacking, they sort of ran up to them and then veered off at the last minute - kinda funny to watch, but annoying when you want to inflict maximum casualties to teach those hairy barbarians a lesson in manners!