Gently, I would encourage you to not view it as "The friend decided that DD was expendable and cut her loose." They are 5. Most of these kids barely know which shoe goes on which foot. I don't think this child likely really decided anything...she maybe just felt like doing something else that day, or was feeling like playing on the swings and your DD didn't, or...
Anyway, the hard thing is, our kids take this stuff more seriously. My DS is also in K and is very seriously invested in making friends. He's very social and generally quite successful, but this is a big new environment and he is also in the minority racially. He is paying attention to all this social stuff with razor-sharp attention and it's very important to him. We have to talk to him about it not being a big deal if a friend wants to do something else that day, giving it more time, etc. He had a friend last year in pre-K who was a bit of a sticky burr (as in, always wanted to be with him and sometimes he wanted space) so we remind him of that.
To me this sounds like an anxiety issue again. I know you have talked about this being an issue with her.