It's not a bug, I was just messing around in the console, trying to give myself the Shackles of Fate, and I gave them to a bunch of enemy units, and it broke everything; they just froze. I immediately reloaded the save before I activated the console, and everything went back to normal. So I continued playing.Luckily, I already found the Shackles of Fate on one of the units, so I don't plan on using cheats anymore.
Added 8 minutes later
I have a suspicion - why, by the way, do Alaric and Valia, as well as Andreas, run away from the battlefield? I looked at the script and realized that they can't run away! Their script is set to prevent them from running away. Oh Elrath, I might actually die of happiness.