I'm so sorry you're going through this, I had a similar experience when I went to uni (I'm 23 and starting a course in September but this uni experience was in 2016!).
I was in a toxic relationship and wasn't close with my school friends anymore, I was totally alone! And to make the situation worse I didn't click with people on my course at all. I became extremely lonely. I made one friend in my halls and I wouldn't have made it through first year without that friendship but I was barely hanging on. In my second year I decided enough was enough and I decided to withdraw. For me it was the course and my quality of student life. It took me a while to feel like myself again but fortunately I found something I really enjoy and I'm excited to go back to uni. I am in a new, happier relationship but my school friendships didn't recover and I ended up falling out with my one friend from uni! I don't feel lonely because I'm happier now but I am nervous about being lonely again when I go back to uni. Last time I didn't make as much of an effort as I could have, so this time I'm going to start by joining a few societies and hopefully I'll make some friends that way!
I see you're considering finding a different university, which is a big decision for sure, but I don't think you would regret it! I'm not suggesting dropping out, but for similar reasons leaving my course was the best thing for me. I'm often told it was a brave decision! So think of it that way if you decide to change. Not everyone would have the confidence to make a big change, so if you think it's right: go for it!