Comedy is mostly about suffering, usually about someone else’s suffering. Many comedians tell stories about humiliating incidents in their lives and we all laugh. It doesn’t matter if they are completely factual, but they should have a kernel of truth.
I’ve done quite a few improv shows in my life, more successful than not. That sounds like a boast but improv is a team sport, so at any given time, there was at least one other person on stage with me.
In one show, I was doing a scene with one other person and I made a snarky remark, that got a laugh. He replied, “That’s’ why your wife left you.” This also got a laugh. My rejoinder was, “At least I was married.” To which the audience, if not outright booed me, made it clear that I had crossed a line.
The question is why is the idea that my imaginary wife leaving me is funny, but the concept of my scene partner not ever having an imaginary wife a step too far? Each comment is equally mean so why is one funny and the other not? Truthfully, I have no idea. I wish I had some sort of profound insight into the nature of humor, but at the end of the day, sometimes, one thing is funny and the other isn’t.
I did say, “I think I’ve alienated the audience,” which did get a laugh. So maybe if you find yourself in a similar situation the best course of action is point out what just happened. It might not work in real life, but give it a shot, you never know.