Where the "but" sneaks in
"I'm sorry I snapped, but you were being really annoying." Everything before the "but" gets cancelled out by what follows it.
Explanations are not bad. They just work better at a different moment, or when the other person asks for them.
Three plain parts
Name what you did. "I cancelled on you twice this month." Be specific about your own part and leave theirs out of it.
Say what it was probably like for them. "That probably felt like I did not care." You do not have to be sure, a gentle guess is enough.
Offer one small thing, or just stop there. "I'd like to make it up with a proper plan. Are you free Saturday?" If they need time, let them have it.
Try it
Think of one small thing you could apologise for. Write it in those three parts, then delete any "but" you find. You decide whether to send it, and sometimes writing it down is enough to see the situation more clearly.

