In other words, I started a battle with one magic arrow, and the AI had a fireball. It didn't cast it, it drained mana, but still didn't cast it. I entered a cheat code for magic, and it cast it.
But I can't say for sure what the exact pattern is (perhaps the strength of magic somehow affects it). And it probably doesn't have anything to do with the battle on UTB either.