There are only two other girls in the class and they have completely gelled as a pair and have never really played with dd (they just have nothing in common).
This you're fine with. But now the other girl has found someone and has completely gelled as a pair, it's not ok. Because it's who your DD wants to play with.
She doesn't want to play with the boys. She doesn't want to play with any of the other children. But because two girls don't want to play with her, they're bullies? They are only "excluding" her from their duo (as per the other two girls who OP seems to find fine) It's not their fault there's no one else that the DD wants to play with. There are loads of other children. DD doesn't want to play with them, excluding herself.
So when you said, there were four girls before, there were actually this "gelled pair" your DD and one girl. So for your DD and one girl, they ended up hanging out as default. Now another girl has joined, and become a "gelled pair" with the girl, your DD has lost her default.
It's not the girls' fault. It's a combination of the class being small, and your DD dismissing every other child there as people she doesn't want to play with.
Absolutely they should not be shouting at her to go away. They don't sound like nasty girls from what you've said. I imagine they just wanted to play and ran off together, maybe it's something like they do a dance class together (you said they do a lot of extra curricular stuff together) and they're practicing the routine together, and your DD kept following/hovering until they got annoyed. They have no right to be unkind. They have no obligation to entertain DD because she doesn't want to play with any other children. It's unlikely that shouting "go away" was their first response. Have they told her three times before that "we just want to practice please".
Either your DD has to accept she can play with any of the other children there, rather than focusing only on these two girls, or if that's not going to happen, maybe look at another school.
We live a bit in the back of beyond, and there is only one boy near us. He happens to attend the same school as DS. All school holidays, DS goes to call on this boy. This boy is round here continually. You'd think they were best pals. When they return to school, they barely acknowledge each other, DS is off with his social group as is the other boy. They play here together, because it's each other, or no one. As soon as they have the option of people they truly gel with, they naturally gravitate towards them. This is all that's happened here. If DS then started following this other boy around at school until the other boy (who I know is not a bad child) tells him to "go away" then I have to take some accountability that my DS is being irritating in order for this other child to act like that in response. No, the response is not ok. But neither is my DS following/interrupting/attaching himself to this boy, who's just trying to enjoy his lunch break, because that's who he wants to play with. At some point, the other boy is going to get very frustrated. I wouldn't be declaring him a bully.
I know this sucks because it's your DD who has to make adjustment here, but whether the girls are shouting at her, or telling her very calmly, they want to play by themselves, actually the end result is the same.