Opening the book…
Explanations placed inside an apology function as arguments, and the other person hears them as a request to be let off. The apology then becomes something they have to manage rather than something they receive. Naming the act alone leaves them the whole space to decide what they think.
Say what you did, say it was wrong, say what you will do instead. Cut every clause beginning with because, I was, or you have to understand. If context genuinely matters, offer it in a separate conversation, later, and only if they want it.
If the other person asks directly what happened, answer them — that is information they requested, not a defence you smuggled in. And if a factual misunderstanding is causing further harm, correct the facts first and apologise cleanly afterwards.