OP, I am so sorry that you had such a long run of ill health affecting you at such a critical age. But no one can take away your intelligence. It's still there and you can still use it.
FWIW, I felt very like you in my late twenties. I got a good degree from a good university but poor mental health and no support meant I ended up working in a greasy spoon cafe, no boyfriend, while everyone I was friends with at uni was married and pursuing careers in law, medicine, the city, living in stunning houses, having children.
My life turned around when I had a good think about what I'd like to do and then just did it. I didn't wait to get employed, I set up on my own. At first I massively undercharged but then a friend put me in touch with a brilliant financial therapist who encouraged me to price my work competitively and to my astonishment I got more clients not fewer. i love the work, and can fit it around my health.
You clearly don't love your work. You find it degrading and you know you'd be happier in a more intellectual role. That's fine. Allow yourself to explore how you might make that change. Is there anything you'd like to do, that you'd enjoy or feel proud of that you could start doing by yourself, freelance? Is there a more suitable role in your current job? If you work in the care system, could you move across to management, or the charity sector of the specific area you have hands-on experience of?
Have you considered the Civil Service or the Police, both of which actively recruit clever people?
And very important: was your health issue ever discovered and correctly treated?
You sound young - as in, no older than early thirties perhaps. You have decades ahead of you, in which to bloom and flourish and make a life you are proud of. You just might need to do it in a less conventional way than the one that is currently blocking you. Most vastly successful people work for themselves, and many absolutely failed at school or uni.
Also, look at your whole life and try to improve all areas of it. Don't feel work alone is the marker of a good life. Getting fit, sorting out where you live, even if it's a rented room, so it pleases you, building a strong social life, exploring where you live etc - all of these are things you can do that have nothing to do with exam grades. Let other areas of your life flourish and the rest will follow. as you'll start to feel more upbeat and self confident.