Sometimes, no matter what you do, you're going to offend people. Sometimes you'll never know why.
Things I have done in the past week that someone has found offensive: listened to loud, "weird" music. Had an opinion about whether or not people who aren't me should be allowed to make decisions about my body. Enjoyed bad science fiction. Had my hair highlighted in preparation for the Hugos. Implied that there's a double standard in how women are expected to dress for the Hugos vs. how men are expected to dress for the Hugos. Implied that it's more expensive to be female. Bought children's toys for myself. Bought children's toys for a child. These are just the things I know about mind you, and I only know because in each case, someone told me. I'm not sure why most of these things were offensive. I don't actually want to know. And that, right there, probably offends someone.
I do my best to Marilyn Munster my way through life, leaving fields of happy zombies and sparkly plagues behind me. Sadly, though, nothing is that inoffensive. Not unless it's, say, a rock, and even that will offend, if it gets into somebody's shoe. There is no way to avoid giving offense. Not if you're a thing that actually exists.
And it can be hard, as someone whose audience is largely online, to deal with the thought that I might accidentally offend someone, lose potential readers, and wind up living in a cardboard box next to the creek. My cats aren't supposed to go outside! (This is the "worst case scenario" mindset. It kicks in when I think I've upset someone. My brain is a theme park that hates me.) Case in point:
A while ago—within the last year, although I couldn't tell you when—someone with whom I had communicated on Twitter, but who I didn't really know, asked me "Why did you kill character X?" I gave the response I always give to that question, which is completely honest, despite having been originally stolen from Stephen King: "I didn't kill them. They just died." I have made the conscious choice to kill very few characters. Most of them are sacrifices to the story, and I'm as surprised as anyone else when I see what's coming. It's an odd answer, but a totally sincere one.
(Example of me killing a character on purpose: I killed Rose. It was sort of essential, since her story hinges on her being, you know. Dead.)
This person did not find my answer sincere. They proceeded to declare on Twitter that I was a horrible person who disrespected her readers and didn't appreciate reader questions and was generally horrid, and then went and amended all their reviews of my books to lower their ratings, so that it would be clear that they did not give good scores to mean authors. So with one statement that I still don't regret making, because it was sincere, I lost a reader, and the aggregate scores of my books went down. And I'm lucky in that this is one of the biggest "bad author, no authorial biscuit" scandals that I've had to deal with so far.
Do I know exactly why my response was offensive? Nope. I've said that to other people without causing offense (that I'm aware of). Did this person explain? Nope. Is that the only time I'm going to cause offense in this world?
No matter what you do, you're going to piss people off. Hell, me saying "offense is inevitable" is probably pissing someone off. So take deep breaths, and don't dwell on it too much. As long as we're all doing our best not to be horrible and hurtful, it should be okay, in the long run.
Even if we never know why.