Zig Zagged: Right before the book ends, it turns out that Bob has cancer. Wait, no he doesn't... it's his twin brother, Carl, who was mistaken for him. Except Bob's been dreaming all this, so he wakes up to victory. Then Alice, the princess he was about to marry, suddenly dies. Or did she?
Averted: Bob's story ends without any cruel twist.
Invoked: The villain decides to withold a certain piece of information from the hero and let him nearly win, just so that the crippling detail can be revealed right before the hero might win.
Defied: Bob decides to live as happily as he can despite the cancer, help as many of his subjects as possible, and be content to have accomplished something great before dying. In that way, whatever evil "author" might be orchestrating his misfortune is denied satisfaction.
Discussed: "What's up with that? Just as everything's finishing up... I didn't even have any reason to expect that... Are the gods mad at me or something?"
Conversed: "What? What kind of last episode was that? Was there any point to that twist besides being mean to the characters?"
Deconstructed: The sudden, jarring doom from left field turns Bob into a bitter and angry man. Knowing he has only a scant few years to live, he sets in motion events to Rage Against the Heavens and slay / replace / create the entity that can properly enforce Karma. And if that fails, he'll bring the universe down with him by becoming the Fisher King and letting his cancer kill both himself and the kingdom. No more sad endings after that, all just to spite the uncaring narrator.
Reconstructed: Except Bob realizes life isn't supposed to be fair, a fair universe is exclusive to fictional characters created by authors who want them to be happy. And he isn't a fictional character... right?