GOT spoilers...
I agree with everything you wrote but this:
Having just finished a full rewatch of the series a couple weeks ago, I can confidently say that you're right about one thing: GRRM did a fantastic job tricking everyone into believing what the characters thought about themselves. As early as Season 1 when she burns the witch alive, Dany has exhibited a nearly uncontrollable and irrational rage. As early as Season 1 when she tells Drogo to get her the throne, she has exhibited a narcissistic attitude wherein she deserves the love and adoration of the people by virtue of her birthright alone.
Dany has never shown that she cares about the common people. Yes, she cares greatly about freeing the slaves -- she was a slave once and the slaves adore her for it. Yes, she is enraged when the masters crucify the children. Dany and her advisors attribute this care and rage to her desire to protect everyone. They describe her as someone who is caring and benevolent. GRRM tricks the audience by telling one plausible explanation and so no one notices when they are shown an alternative, plausible explanation. Dany is not benevolent and caring, she believes she deserves the throne over all others and she believes her authority should not be questioned. She will happily kill anyone and did massacre people by the 1000's simply because they dare to take a different point of view.
So when Dany gets to Kings Landing, she is there to punish those who would not stand behind her. If the people went into the city to flee her, they did not believe in her and therefore deserve to die in her mind. And so she kills them.
Now don't get me wrong, the post-episode behind the scenes illustrates that the showrunners/writers had no idea what they were doing or why, but the action itself is supported by Dany's character and actions from the very beginning. We know GRRM gave the writers a brief version of what he expected to happen to the characters. Presumably, Dany obliterating Kings Landing with innocents inside was one of those things. The writers followed orders, but they failed to understand why. Thus, what should have been another Red Wedding-calibur shock followed by revelation that we'd missed everything the whole time instead fell flat and appeared to be wholly inconsistent.
So the writers did fail us here. But the actual action was not the problem -- it was the reason why.
Game of Thrones always made sure to do subtle things that made you think Dany was being good and altruistic when the truth was she was a bloodthirsty conqueror.