It’s tough OP - we’re struggling with this dilemma too. Slightly different scenario as we’re in a busy suburb and are well embedded in the community, but DD is an only with only one cousin, who lives overseas, and she hasn’t settled in her class at school.
We are looking to move as well. Our longer term plan was always to move for secondary anyway, but given that DD hasn’t bonded with the children in her class I think we may bring this forward. She gets on better with the girls in the parallel class and we did try to get her current school to move her, but they refused (as an ex primary teacher myself I know that schools hate doing this). DD’s social issues are made worst by the fact that she’s the only academic, motivated girl in quite a challenging low ability class, and sticks out like a sore thumb. It’s not typical for the school and just one of those ‘luck of the draw’ things, but upshot is that she is playing mainly with much older children and not with her peers.
She does plenty of extra curricular stuff out of school, which DD loves, but we have the same issue as you in that it’s all very fleeting and transient - not enough time spent together to make ‘proper’ friendships. And during school holidays it’s really just us and elderly grandparents etc - we have plenty of local friends but find that people are either busy with work or tend to retreat into their families so aren’t open to spending time together in a casual way.
Our plan is to move out of London within the next couple of years to a market town near a smaller city. We’d aim to get very involved in the community to help build relationships for us and DD. The place we have in mind has just the one (large, very good) school and all local children go there, usually walking to school etc, so we’re hoping that it’s all a bit less transient and fragmented than where we are now (where children go to lots of different secondaries and are ferried around by car) and will give her continuity as she grows up.
And yes, also what a pp has said about making your house a welcoming sanctuary for DS and his friends - we have always said that we’re open to sleepovers, taking friends on holiday etc as DD gets bigger. It can be tricky to engineer this scenario though, I think.