Anything by David Cage. Actually, I can't think of the first, there are seas of untold games, films, stories that have shit endins. Loved the ending to the Myst film, that was a true "aw hell no!" ending. No matter how bad you think things are, they can always get worse. No film has dared that particular idea before as far as I'm aware. The ninja turtles Michael bay remake had some cringeworthy boss fight with terrible costume and choreography, but still not first. I think the whole matrix original film bullshit of "love brings people back from the dead by dramatic kissing" kind of shat on any good will at the time. But then I watched Steven seagull movies before that and am pretty sure my subconscious is currently blocking all their terrible endings.