I feel for you and have some insight into how you are feeling.
It is fear that is trapping you in this situation.
But what is causing the fear ?
Is the thought of being rejected and the emotional discomfort you will have to endure ?
Is it a fear of not being able to continue a conversation ?
Is it a fear that you think someone will recognise or discover some part of you you desperately want to keep hidden ??
Is it the fear that someone will realise you are terrified of being how you are now ?
Beleive me, even the most outwardly confident person has fears, and a lot of those seemingly outwardly confident people have learnt the art of masking their fears so few people notice them. This is why there is the adage that bullies are really cowards.
When I was a baby I tried walking. It was difficult and I had to try many times before I could even stand on my own. I have no idea how many times I tried and fell, but I persevered until I could stand and walk from one peice of furniture to another. This is how life is.
If you are in a crowded room I bet you are not the only one feeling isolated, and I bet you are not the only one who doesnt want to feel isolated. Tell someone how you feel. Maybe you can see someone who looks as alone as you feel. Tell them, I hate these situations. I seem to spend the whole time wishing I wasnt here. What do all these people find to talk about with each other. You might be surprised how welcome your honesty is seized upon. Like that baby who kept falling down we can only keep trying.
One action I took which changed me and my life was I enrolled in a public speaking course.
I remember a surgeon being in the class, he stuttered and just about told the class his name, but my goodness, by the end of the course he was an oratory superman. Imagine going thru school, college, university, medical college, working night and day in a hospital setting, specialising in a medical subject to be a surgeon, and yet, be terrified to speak to people ... what hell he must have lived thru .... but, the moment he admitted his "problem" all the help and encouragement he needed was there for him.
You can do it for yourself. Next time you are in a group setting speak to someone, Ask someone if they enjoy those functions, or do they hate them. You could be the lifesaver someone else is looking for,,,,,,,,,,