Loghain did nothing wrong
For the most part, I honestly think he didn't. Cailan was an absolute idiot and was more interested in glory than actually ending the darkspawn threat safely. I'm pretty sure even
if Loghain didn't pull back, Ostagar would've ended in defeat anyways.
Not to mention that the Archdemon wasn't even around then either. If he doesn't go down, neither does the blight.
Loghain's only real error was thinking he didn't need Gray Wardens to defeat the Archdemon, and you can't even really fault him for that either since it's not common knowledge, like most GW things.
It's kinda funny that I'm even defending him because I absolutely despised him my first playhrough, but once you learn more about him, it really paints him in a different picture.
---Regardless of warnings, the future doesn't scare me at all.
This is where the fun begins.