I recall a long time ago, I think it would be the mid-90s, there was a Canadian TV show where this actually happened. I think it was on CBC and I remember it was played mostly as a comedy, but it didn't have a laugh track. There was a guy running for election (for mayor of Toronto ?) who was very polished but also very dumb, and much of the show was about the extremely jaded and cynical campaign staff running around putting out the fires he started while campaigning. By the end, the public mostly hated him and he was destined to lose, but on the election day he had a heart attack, and in a surprise sympathy vote, he won. In the final scene of the show, they find this out sitting beside him at his hospital bed, and were about to all celebrate but they then realised he had just actually died.
Can someone help me remember what show that was? Somehow I think it was connected to another show, like a spinoff? Because most of the cast were in that other show which I think was called The Newsroom? It was about a local news station (note it was not the show ENG, it was a different one which also played as a comedy but with no laugh track).