I am not aware of the actual equation, but I believe number of your unit lost - number of enemy unit lost (or vice versa) plays a significant role when AI decides who is winning (at least in BTS, it did), besides the power graph.
So, I guess that the problem might be caused by fireballs and other summoned creatures? If the AI counts player's sacrifices of fireballs and summoned as their winning points, it might misunderstood the situation and think "oh yeah, I am winning", whenever a player lost 10 fireballs to kill 5 units stack of the AI.