Some people will find no humor acceptable, so I don't think anyone can ever aim to meet one, universal, standard of what's acceptable.
Personally, I keep my own humor aimed at either myself, the world in general, life in general, etc. - and don't ever use humor that (even if I were to think it's funny) could at all be mistaken for putting someone else down. Although I do use some light self-deprecating humor, even with that I stick more with things like "what a dummy I am" (because I left my keys at home), rather than "I'm a general loser" type of humor. I just see humor in too many things that don't put anyone down (someone else, or myself) that I don't think it's necessary (and know it runs a risk of being misunderstood/misinterpreted.
Also, sometimes close friends understand one another's humor more than, say, a co-worker or less close friend may; so as with so many other things in life, I think some types of humor are yet something else that can be appropriate between close friends but might be "risky" with someone not as close.
I wouldn't call your example "too harsh". I'd instead call it "taking a chance one doesn't really need to take (and that may not be advisable) in the workplace".