Hey OP, I left my marriage (divorced now) about 10 years ago and went to live as a lodger in someone else's house. Was late 30's at the time, and not what I wanted to be doing as I was hurtling towards the big four - zero at the time, and it felt like a backwards step, but I'm so glad I made that decision. My marriage was terrible and I knew I couldn't stay, I had to leave, even if that meant flat-sharing/ being someone's lodger.
It was a step forwards, although as I say it also felt like a step backwards, but really and truly, it was the first step to making a better, happier life for myself - I couldn't see how happy I was going to end up being by leaving, at the time. It's hard to imagine that far ahead when you are so desperately unhappy in a marriage.
Advice, wise: if your gut is telling you this is what you need to do, then listen to it. I don't know what your particular feelings are about going back to flat sharing, but there is no shame in it, whatever our age. No one has a perfect, linear life, and we figure things out as we go along. Figuring stuff out is what matters, and making adjustments however uncomfortable at the time they are - this is what matters rather than maintaining a status-quo that serves us nothing positive.
Try and view it as the first of a number of positive steps you will take to get your life on a path that will bring you happiness. Flat-sharing doesn't have to be forever (unless you end up wanting that, of course!).
Also, have a think about what sort of arrangement you want, i.e. would you prefer a flat share where everyone mostly keeps to themselves, or do feel that living with really social people who want to chat and spend time with you some evenings/ days out would be preferable?
How many people would you like to live with?
Consider being a lodger also - in my experience (I was a lodger in the past, pre-marriage, and also flat shared pre marriage), it's a slightly more straightforward arrangement as there's no hassle of yourself and the other flat mates having to find replacement people if another tenant leaves, which is a situation I've been in a few times.
Think about what is possible with your budget, and what are deal breakers for you - do you want a garden? A balcony space? A communal lounge? Near to a station? Write yourself a list of what you definitely want, and what you'd be prepared to not have.
If you don't have to move imminently, go and arrange some viewings and just let the idea settle a bit more, it might help things feel more real, and help you to mentally and emotionally prepare. Also, don't panic if you go see somewhere and it's awful - it definitely doesn't mean the next place you see will be awful (it's a mixed bag of standards out there in my experience!).
My own experience: I felt HUGE relief once I moved into my new place with my then landlady. It was absolutely fine! I slowly started putting my life back together, ended up also renting a cheap art studio nearby after about 9 months of leaving my now ex-husband, and began to enjoy all the things I'd been missing for so long. After 2 years I decided to move closer to my job, and to a nicer part of town and so I then lived in a flat-share with 3 other women for another 2 years, then a few years ago I decided to move north, and rent on my own - my job became permanently wfh, so I took advantage of being able to have cheaper rent where I currently live. I now have a really spacious 2 bed flat close to a lovely, small city by the sea, and am so much happier. It's not mine, I don't own it, I left my ex husband with nothing, and I may never own my own home again. However, life is a million times better than it was. I regret marrying the man I married, but zero fucking regrets about taking the leap and leaving (in my case with nothing) when I did.
Good luck to you OP, feel free to PM me if you want.