Don’t be “sorry if” anyone was hurt by your words or actions. Be sorry *that* you were hurtful. Own it.
The “if” adds a shadow of doubt— hey, maybe you didn’t say or do anything nasty after all! “If” is cowardly; “that” takes responsibility.
Similarly, “it distresses me that you’re upset” is weaselly: You’re implying that their reaction has caused you grief. A good apology is not about you.