If I happen to find myself in the vicinity of someone I know, but who is more of an acquaintance than a friend, I’ll engage in a few pleasantries but stop short of inviting them for a chat in a coffee shop, or whatever the grownup equivalent of a play date is. I certainly wouldn’t immediately tell them to go away like those classmates were doing to the Lucy's DD.
There is a happy medium in social transactions between friendship and ostracism. To echo what goingmad says above, teachers can’t insist on classmates being friends or that everyone invites everyone else home for tea - but they can insist on a basic level of civility in the classroom and playground.
And I would also like to see teachers recognising that bonding through exclusion is a real social phenomenon that ought to be addressed. As Sigmund Freud writes in Civilisation and its Discontents:
It is always possible to bind together a considerable number of people in love, so long as there are other people left over to receive the manifestations of their aggressiveness.
An exclusive group in the playground may feel cosy and special if you are part of it but can do lasting damage to those who are designated the role of outsider.
My DS’s primary school years were also blighted by this phenomenon of bonding through exclusion. It affected him quite deeply. I eventually removed him from the school towards the end of Y6 and home-eded for that very reason. (It was so late in the year that ‘home-eded’ actually meant taking long walks and eating ice-cream with a bit of educational chat thrown in!)
For him, moving on to secondary school was like leaving a black and white world and entering a technicolor one. He would come home from school and say in wonderment, ‘They are treating me like a normal person!’
So, Lucy, please tell your DD that she will meet her people – but she may have to wait until she escapes from the petty conformity of the primary school playground to do so.