I definitely wouldn't force her to stay.
Some practical suggestions: Have you had friends come over and spend the night at your house? If not, that might be a good way to start. Or shorter visits to friends' houses - is she fine with spending a long time during the day, and this only comes up overnight? Does it happen at everyone's house, or only at one house (if so, maybe there is something weird going on there). Or maybe, if it would work out with the other parents, you could arrange to stay over also in another room, so that you'd be available to her if she needed you. And maybe even participate somehow, telling them stories or doing activities with them or something. I don't know how you're dealing with it now - I think it would be best, if she is at their house and gets anxious, for you to be available and willing to come right away and be with her and bring her home if that is what she wants (rather than trying to get her to stay and waiting until her anxiety gets worse).
About her anxiety: I'd recommend spending some time with her (either while it's happening, or at another time when you can have some uninterrupted time together), encouraging her to talk about her feelings, listening to her, accepting and acknowledging and empathizing with her feelings, allowing her to cry and shake and express herself and release some of her anxiety. NOT trying to talk her out of it. As you know, she can't consciously control her anxiety, and trying to talk her out of it or trying to get her to push it away and forge through it, doesn't work very well, even if it seems to in the short run. Especially since you have experienced similar feelings, you should be able to empathize. On the other hand, since it might be hard for you to be as present with her as you'd like to be, since it might trigger your own anxiety and thereby increase hers, it might be good for her to talk with someone else, and adult friend she trusts or a counselor. It sounds like there is probably something deeper going on with her, either something current in her life now (school, friends, etc) or something from the past that gets triggered when she is away from home, it may even have roots in the pregnancy, if you were experiencing anxiety then. And it may be that some or all of her anxiety comes from your anxiety and that she needs help in separating that out (please don't take this as blame - it's totally understandable). This manifestation anxiety can be a good opportunity for her to do some healing, which will help her throughout her life. I'd recommend Aletha Solter's books, Helping Young Children Flourish and Tears and Tantrums, she has good ideas for helping children work through difficult feelings. And Peter Levine has some good information about children and trauma.
And, I think it's wonderful that she is so in tune with her feelings and talks with you about them, and that you care so much about her and listen to her, that is a very good sign. Wishing you the best!