I didn't think I was ugly because I thought I was ugly. I thought I was ugly because no one wanted anything to do with me for reasons I couldn't comprehend.
I don't want to offend you or anyone in any way, I just wonder if it could have been a case of neurodiversity (you being neurodivergent in a way socializing didn't come as natural as for others).
In my case, I understood my own differences a little late. I was rejected a couple of times because I was apparently showing-off. I connected the dots years later: I was being too effusive and intense, which was read as arrogance or cockiness.
A friend of mine struggled with his autism. People during his school years thought he was grumpy (or worse), when in reality he was having a hard time coping with external stimuli and information.
People can see something is different, but many (even as adults) are not kind about the explanation. Instead of thinking that you are a shy person (or whatever trait they are judging), they might think you think you're better than them or whatever.
It's funny how many people default for an option in which the "weird" person is a bad person somehow, but there's probably some evolutionary adaptations to partially blame...
I also noticed how "pretty" people didn't have anywhere near as hard of a time socializing as I did. They were allowed to have bad personalities. Even if I was as kind and helpful as I could possibly be I'd never be treated the same way as a "pretty" person would.
Same as my last paragraph. It's human nature to make judgments based on taste, on personal preferences, etc. "Pretty privilege" is real, and we should outgrow it, but... yeah. It even affects people deemed attractive as they cannot trust the same, they cannot escape things like comparisons, etc. Let's not talk about the bullying for the other side. It's vicious.
I hope you're okay after that experience.
https://lemm.ee/comment/11472049