Ah. Well, if you go onto the Ofcom website and have a look at the broadcasting regs, the "standard" C4 response makes a bit more sense.
Ofcom are not bothered by whether what is broadcast is legal, eg whether it is discriminatory. It's up to the courts to chase that up and KP's lawyers will be all over that if there's the slimmest chance of pulling it off. Ofcom's remit is (in this case) simply to decide whether material is "offensive".
Per the regs, the degree of offence can be mitigated or justified by its context. So eg what is offensive in a drama is different to what is offensive in a news programme: most would be OK to watch a dramatized death but uncomfortable watching a real one. Ofcom also specifically advises broadcasters that the offence of many items can and should be reduced by appropriate warnings. So, Ofcom's guidance is that if something is a joke, broadcast late at night to an audience warned that the material is offensive, most people will be OK with it.
The counteracting principle of the broadcasting guidelines is that the commonsense rule of what is "generally acceptable" should apply. Pretty much anything you say will offend someone, but if what you say offends most people then you shouldn't be broadcasting it.
My reading of the regs, therefore, is that if most people are offended by the material despite the comedy context, late hour and specific warnings, then the material is offensive by Ofcom's definition - and the regulators should act. Which is why C4's response is wrong. And why I hope the regulators are going to fine them to kingdom come.