If you create something that has a controversial reception, you have two choices.
You can try to explain what your aim was, that you were coming from a good place, that actually what you meant is not what the public understood, that it’s not your fault and that your original idea was actually to support the feelings of the very same people that are now involved in the controversy.
Or you can apologise.
Take this Dove ad from last year.
It does not matter that Dove wanted to represent female beauty in all its shades, nor that the bit under scrutiny was only a short part of a longer ad in which (among other things) a westerner-looking woman was turning asian. It does not matter what the female Nigerian actress thought she was achieving while recording the ad, and honestly after the controversy sparked, the ad itself and its aesthetic stopped mattering as well.
Dove did not fall into the trap, it understood that all that matters in these circumstances is the public and its sensitivities. As marketers (and as creators), we need to be aware that what we do today can reach a much bigger audience than in the past, but at the same time it gets subjected to unprecedented scrutiny.
There are two things that can help stay clear from this kind of publicity.
First, make sure what you do is in line with a consistent brand that you are continuosly building. This gives credibility in the eyes of the audience, and it raises the odds that what you mean is what will be understood (take the recent Gillette ad as an example).
Then, surround yourself with people that are the most diverse possible, in every achievable way. And carefully weigh in every one of the concern they might raise on your job.