I had it happening to me three times.
I think it's simply a bug, where it's the wrong general who gets the "doubtful courage" trait (it should be the one who retreats, and it's the one who attacks).