This has happened to me several times. Moreover, it's always the strongest and most developed enemy hero with the best army who freezes, which makes the game boring afterward.
Is there any way to solve this problem? I can only assume that this is some kind of peculiarity of the AI algorithm.