Two of my co-workers were saying the same thing as you about Dany's abrupt turn. They thought it felt like an afterthought that was tacked on. When I watched the episode I didn't quite feel the same way. I thought Dany did what she did because of Jon. I think she's paranoid about Jon's claim to the throne and felt that she would rather burn it all down rather than to let him have it. A "If I can't have it, no one will" mindset. Dany's own madness.
Once Dany decided to execute Vary's, I felt that she was not long for that world. Her madness dragged Grey Worm down as well. If Dany and Grey Worm survive the last episode, I'll have a huge issue with that.
Did anyone else feel the white horse near the end of the episode was being warged by Bran? I felt it maybe Bran guiding Arya where she needs to go. The death rides a pale horse symbolism was strong.