Don't be too hard on yourself. The fact that you remember the incident and feel that regret shows a lot of emotional maturity and self awareness. I doubt many others that attended the talk that day even remember it.
A surgeon, while operating with all diligence and conscientiousness, may from time to time kill a patient. That's life, it's table stakes to having surgery at all. The notion that it's cool if she jokes about killing the patient to "cope with her emotions" -- esp in an auditorium full of people -- is just fucking ... I dunno what to tell you if you think that.
then what do you wish you had said?
(I too find that joke distasteful)
It's worth noting that I don't think saying that would have affected my career. I didn't say it because I didn't have the guts to stand up to the mob. Thus the guilt.
Hilarity. The room bubbles with laughter. Just enough transgression.
I remember in that moment bubbling with rage. A famous and well-regarded paragon of the field [1] who had recently come to the university to give a talk spent his career characterizing animal emotions, especially of mice and rats. He revealed their rich emotional worlds in glorious detail. The presentor, his advisor, many of us in the department knew -- or should have -- how un-funny the joke was. We were perfectly positioned to know it.
Despite knowing what I knew, I didn't say anything. That silence is still among the top few of my regrets. I guess I learned the weight of doing the right thing in a packed room full of people with contrary opinions, and learned that I was way less strong / bold / principled than I had believed myself to be; which was remarkable, as that bar was already low.
[1] https://en.wikipedia.org/wiki/Jaak_Panksepp