They absolutely did not do a good enough job of setting it up, but in retrospect, they did set it up. She didn't go crazy in three minutes. She has been a little crazy all along. She had violent impulses all along that have been warring with her conscience and mind, held in check by the people she trusted. We took that to mean that she had a good heart, but I'm seeing it differently now. We've seen over and over that she's willing to kill anybody who crosses her, and do so in horrible ways, and that her mercy is for those she identifies as innocents. This season has been all about the straws being piled on the camel's back, one by one, in rapid succession. At the beginning of the episode we see her sitting alone, stewing in her own paranoia for days. When Tyrion comes to her, she expects that it was Jon who betrayed her, then threatens Tyrion, then confronts Jon as a betrayer anyway, then he refuses to serve her (in her eyes), and on, and on, and on.
She's made it clear over the last couple of episodes that the thing she really wanted to do was burn the biggest betrayer (King's Landing) to the ground. She went in there fully expecting that she'd do just that. Then, suddenly, she couldn't. They surrendered. They took away what she wanted. And she snapped. Not in three minutes, in about 20 seconds, but that 20 seconds was the breaking point of the madness that had been building, not the whole break.
She's been nucking futs all along. We just didn't think of it that way at the time.
[This space left intentionally blank.]