Question for everyone, has anyone encountered this? I personally encountered this bug for the first time.
As far as I understand, a Stronghold was built in the Castle, and the Earthquake spell was cast several times during the battle.
In this case, it is most likely a Soda bug: if you cast Earthquake in a city with a Fort/Stronghold, and one of the "hits" of the Earthquake lands on a non-existent side tower, it will "disable" one of the defending stacks instead of the tower, and this stack will not necessarily need to be killed to win.
The bug may repeat when replaying the battle (if you cast Earthquake).
Here is a map (for Soda, but it also works on HotA) where you can see this bug: https://www.dropbox.com/s/992ornaedelb3af/%5BBug%5D%20Earthquake.h3m?dl=0
You need to attack the city and simply cast Earthquake every round. At some point after the cast, an automatic victory in the battle may occur.