What happened to her has literally been foreshadowed the entire series, and was obvious in ep2 when she pulled away from Sansa. As soon as ep3 tied up the other thread it was obvious what was going to happen in the endgame.
It's also nothing like LOST. That ending rendered the entire show incoherent and inconsistent. GOT by comparison is still telling a linear story with internal consistency in tact - it's just a rushed, dumbed-down ending.
Edit: The petition just passed 250k.
The problem with the twist is that the writers seem to confuse foreshadowing with character development. While it might've been foreshadowed, at no point does it seem plausible that Daenarys as built up in this show have gone fully genocidal for no reason. Dany in the show has always had a violent side, but at the same time the writers have always written her as a generally good person. It's a thing they have very deliberately done to get that 'shock value' moment in this latest episode, as even in the latest episode you have Dany claiming 'our mercy for future generations is our strength', yet she completely handwaves this away three scenes later where she kills all these future generations.
And while you could say "Well, she lost all people dear to her", that happened in the two episodes before the episode where she went crazy and once again, there was no reason to assume that she wouldn't just attack Cersei out of revenge and instead target everyone in the city but Cersei. This is somehow made even worse by the Inside the Episode where D.B. Weiss confirms that Dany only decided to go on her genocidal rampage after the city has already surrendered, somehow making her seeing the Red Keep the defining factor.
An easy comparison can be made with the way Harry Potter's Snape twist was handled. Alan Rickman was told very early on by J.K. Rowling that her plan for Snape was that he wasn't the villain he seemed to be, this allowed Rickman to play Snape with a bit of a mysterious edge. GRRM apparently told D&D very early that Dany would burn the city and go 'mad' (something that is more obvious in the books), yet D&D kept writing Dany as the saviour of the innocents and poor. Emilia Clarke apparently also wasn't told until this season that this was the way her character would go, which made her acting also seem very earnest, at no point would anyone assume Dany as played in the last seasons is balancing on the edge of being sane and good or a total maniac.
The worst thing is that even within this last episode the twist could've made narrative sense. What if she had gone straight to the Red Keep and had burned all the people crowded in front of and in the Red Keep because they were in the way between her and Cersei and she was just so crazed by revenge that she didn't care for collateral? That would've been way better than her murdering innocent men, women and children just because.