Knee-jerk answer : No. Player has put a lot of efforts in making his character win, so narratively stealing away his victory and sense of accomplishment would be very frustrating and unfair.
But in practice, it happens surprisingly often, with surprisingly awesome results. I will try to avoid spoilers. But a few games where you play a "bad guy" do end up with your demise, in a very satisfyingly moral way, a bit like the old hollywoodian noir movies that made you sympathise with gangsters and robbers, but end up teaching you that "crime doesn't pay, mkay" ? It's, in a way, part of the genre ("destiny catches up", etc), and part of the ending-with-a-bang. Especially if the game is gritty and all.
Some games play it for fun, which is cool if the plot hardly matters anyway. I remember a nice platformer with my character being squished by something irrelevant in the outro scene. This was in tone with the game, and amusingly brutal and short.
Some bad endings are still epic endings with a huge sense of accomplishment. It's bitter endings that satisfyingly close a cycle. I've seen this in RPGs, with well developped story and characters. Sometimes unavoidable, sometimes due to my very choices (and I wouldn't have chosen anything different). It helps if you are a bit ambivalent towards your character, and judge that he kinda deserves some punishment (because karma, see).
And then, of course, there are the cases where you hadn't realise you were the bad guy. But that's quite rare, isn't it.
So, yeah, I guess it depends on what kind of "bad ending" we are talking about. Totally immoral endings are very rare when the player plays a pure white knight, but when he doesn't, what does constitute a "bad ending" actually. Is the main character's point of view the only one that matters, and does the player dissociate his ?
All in all, I think that "bad endings" in games don't work very differently from movies. If they make a point, or strengthen the universe, they're okay. If they're random and capricious, they may feel like a scripted AI bitch move. Like the computer pouring its own coffee on McReady's legs when losing at chess...
Post edited June 17, 2013 by Telika