I solve it by giving them "Halt" command, they lower their spears all of a sudden and kill many enemies instantly, which also causes the break of morale. It's still an annoying bug though.