Why is my flatmate suddenly acting weird around me?

I am in a bit of an awkward situation with my flatmate (I'm m25, she's f23). We've been living with 2 other people who we have little contact with for 3 months. We slowly became quite good friends over that time and we are in the same friend group. So we hang out regularly anyway.

There was a period a few weeks ago where we got along really well. There were some signs that she may have caught feelings for me at that time but that's something I'm not sure about at all now. Anyway, soon after I feel things between us got a bit tense and cold. Whatever the reason, I don't know.

By now, it is really a mix of highs and lows. On a good day it feels like we're almost back to where we were when everything seemed fine. But on the low days I feel like she is avoiding me, almost as if she were scared of me. Normally I would just accept this as her not wanting to be around me at all or disliking me for some reason. Then the next day she will out of nowhere initiate some plans where we will be together. Or randomly join me studying or cooking.

I just can't figure out the problem. I noticed when we are in a group it's like she's unlocked and we can talk normally and have fun. But when we're alone it's so much more tense save for few bright moments that seem to come and go randomly. I admit that some of that may be my fault as I find it hard to have a relaxed conversation when I feel bad vibes coming from her.

At this point I'm really doubting if it wasn't me who at some point accidentally acted dismissive towards her? It could well be that there was some misunderstanding but I can't think of a situation that would be big enough to cause such a lasting change of mood. I mean we're not dating or super close friends, just flatmates who became friends by happenstance. Either way, we can't seem to break out of the cycle now. I would like to get some idea on how to solve it because I really liked where we were headed before. Now I'm scared we will eventually grow apart.
Why is my flatmate suddenly acting weird around me?
Post Opinion