There are certain situations when you can't withdraw, there is a notification telling you on the pre battle screen if you withdraw the army will be destroyed.