I have had the same situation, but it resulted in defeat as well as the loss of the entire army as I had nowhere to go to if I lost. I've not experienced it since, but I make sure that the stack led by the general is the last unit you move to attack the enemy; of course it maybe a bug & the attack order has no effect, but maybe worth a try in future.