“Sorry if you were offended” is an apology for their feelings, not your actions. People can tell.
GRATITUDE
GRATITUDE
An apology that starts with if is doing something sneaky. It moves the subject from what you did to how the other person reacted, which quietly suggests the real trouble was their sensitivity. People hear the swap even when they cannot name it, which is why that particular sentence so often makes things worse instead of closing them.
A real one is short and names the action. I said that in front of everyone and it was not okay. No if, no but, no account of the hard day you were having. That part can come later if they ask for it.
Which of your apologies quietly blamed the other person’s feelings?
Free, with nothing to buy inside it.