Friend seems to try and ‘punish’ me when she’s mad at me

I have a friend who has a pattern of randomly going in moods with me and when she does this she just ignores my messages for like a week, instead of telling me what’s wrong.

Last time she did this next time we spoke I asked her what had been going on and she admitted that she’d been annoyed (the reason wasn’t actually something I’d even done, it was something a friend of ours had done, that I was kind of getting blamed for). Other times she sometimes denies anything has been wrong and goes back to being completely normal with me.

When she withdraws from me like this I feel anxious and I have thoughts like ‘she’s trying to punish me’, it feels like I’m being put on the naughty step. And I feel like she gets a kick out of knowing that I’ll be feeling anxious (because she knows I get anxious about my friends).

I don’t know how to handle this in the future. I’m working on believing it’s okay if she’s mad at me sometimes and I don’t have to make it mean anything about me. I’m also struggling with the below model:

C: Jasmine hasn’t replied to message
T: She’s trying to punish me for something
F: Anxious
A: Spin in anxiety, wonder what I could have done wrong, obsess over it, check my phone for if she’s replied, look when she was last online
R: I punish myself

C: Jasmine hasn’t replied to message
T: I don’t want to ask her what’s wrong because I don’t want to play into her hands
F: Justified
A: Resist asking her what’s wrong, judge her for not just speaking her mind, not speak my mind, bitch about her to other people
R: ?