“i’m really sorry that i offended you. i didn’t mean to but…”
but? but what?! any apology that includes the word “but” is a non-apology, an excuse disguised to look like an apology.
“sorry” is all that you should say: don’t let words like “but” get in the way.
apologize in private: if you’re in the office use a boardroom or take the person out for a coffee when making your apology. making an apology can be uncomfortable enough, you don’t need an audience.
did you miss anyone?: if the offending behaviour took place amongst other coworkers, they too may have been affected. think about apologizing to that group as well.