It just happens, it may be 0,1% of battles as we notice it only when it happens, not when battle replay is right. But results can be drastically different. Llamabeast has not some data from llamaserver about that bug, so there is a chance it will be fixed.
I cannot begin to tell you how much that sucked. My best troops, some good mages along with cannon fodder, fighting a risky and tiresome battle and emerging victorious, only to vanish afterwards and leave the field to the banners of Ulm. Meh, I guess it happens