Unsolicited forgiveness usually comes across as an attack, why?
Because it’s so easily interpreted as virtue signaling/self-righteousness…by them as “you think you’re better than me”, or from you as “I’ll forgive you even before you acknowledge something wrong was done”.
It’s often not the intention, but can much too easily be how it’s interpreted.
A better way is to communicate how you felt and let the other person decide what they’ll do with that information, and whether they’ll apologize or acknowledge how they were experienced.
And of course, forgive them, but communicating it too soon may cause more trouble, not help the situation.