It's painful. No point in denying it. I think you are helping her by encouraging her to take the long view.
Right now, she has little control over who she is friends with. But soon, life will open up.
I encouraged DS to develop good social skills, to appreciate casual friendships for what they are while looking for deeper ones, to have at least three different places to find friends who he might gave lots in common with.
That last thing helped. He plays an instrument, so he joined a band, he signed up for some charity work and he started attending in-person meet ups from an online interest group. All three areas turned into close friendship groups, two of which are still strong, well into his twenties.
Encourage her to get involved with things she really cares about, outside of school.
There's no point pushing for deeper friendship with people who exclude her. She's better off quietly withdrawing and putting her energy elsewhere.
I recently had to work away from home in a place I knew no one. I tried to befriend people nearby but they made it clear that I was not wanted. I'm old enough not to take it personally and just trust nicer people would arrive. And they did. I ended up meeting some wonderful people but would have been unhappy trying to develop friendship with people who always made me feel like a hanger-on. Teach your daughter she is worthy of good friends and if these people are not behaving like good friends, it's them that are not worthy of her, not vice versa. Hard to believe at her age. But it's true.