Question: Sorry if this is off topic, but this seemed to be the best site to ask.

I can think of several examples of the use of a narrative technique: a last-second change in mood, often occurring so close to the end of the work that the audience cannot respond to it, potentially forcing them to reinterpret what they've experienced up to that point.

A plot twist that doesn't change the mood of the story (such as the reveal in *The Usual Suspects* or the "Wait, the monster isn't dead!" cliche in horror) is not an example of this, nor is a plot twist necessary for this to occur (The absolute best example of this I've been able to find is in [this short animation](https://www.youtube.com/watch?v=XMv5xMwdau4)) though one can be a catalyst (for example in the 'true' ending to the game [*The Witch's House*](https://www.youtube.com/watch?v=37FWMIPvN3g)). It is distinct from Bathos, though if applied properly Bathos could be an example of this. It is perhaps the same as or at least a narrative equivalent of a similar technique in music, for example in the opening theme for the game *The Legend of Zelda: Majora's Mask* (which also uses it to a degree in the opening cinematic it plays over) or with the more commonly used Picardy Third.

My apologies for the lack of links- my reputation doesn't allow posting more than two. I'll edit this once I can, until then it shouldn't be too hard to find what I'm talking about using google.

Answer: 
One term would be [mood whiplash](https://tvtropes.org/pmwiki/pmwiki.php/Main/MoodWhiplash)

> 
> Fiction often has far extremes. They cover the gamut of emotion, from tragedy to comedy. Sometimes, these two will be so close together that they make the viewer's head spin!
> 
> 
>
This might be a too “micro” a level, but I wondered if [Paraprosdokian](https://en.m.wikipedia.org/wiki/Paraprosdokian) might be the device you were looking for.