Yeah I've suffered from the same thing before and still do to a degree, even to this very day.
On one hand it has been out of your control due to being given a bad deck of cards. For you, that "bad deck of cards" was a parent figure who seemed to be very harsh and unforgiving. So because of that, it's hard for you to forgive not only others, but yourself as well. However, even with a bad deck of cards it's still possible to win. It'll take time, but eventually you can change it all.
For me, my "bad deck of cards" was my family always pointing out my worst attributes or finding something to complain about.. out of literally nothing. I swear there was one seemingly peaceful morning until someone just ridiculed my existence for 20-30 minutes straight because he didn't like the way I put cream cheese on my bagel, like WTF! And the rest of the family just added into the negative energy. I know that sounds stupid but it'd just be 24/7 hate for just existing. There'd be 5 others in the living room and they all twist my words and laugh at me for their own entertainment. Or like the time my brother came home after not having seen him for many months and rather than hug or dap each other up like some brothers, the first thing he does is make fun of me. And now years later after all that torment he's surprised that I talk to him however I want to and always make fun of him for HIS flaws, but it's not surprising to me as that way of talking was the only example for me to learn from. Life is a mirror and I'll treat people how they treat me. I'd rather do that than be a pushover or emotional punching bag the rest of my life. Because there's only so much pain you can take, before you just can't take it anymore... and I swear hanging around them genuinely made me want to end it. Although, instead of treating him poorly, the more classy way is to be a gentlemen, maintain control of my emotions, phase people like that out of my life and make room for higher quality people, and not get down to their level. It's just hard when you're young and still dependent on your parents.
So really the best move is to just stand up for yourself and not take any BS from ANYONE or else they'll just keep on treating you like that. I'd rather have a rocky relationship with my brother than a rocky relationship with my brother where he steps all over me. In prisons they'll test you to see if you have enough self respect to say "no" when they ask for your food. They might beat you up for it, but if you put up a fight then they won't bother with the trouble of fighting you over a measly piece of corn bread the next time lol. If you allow others to talk shit to your face or disrespect you then they will keep doing it. You've gotta have a balance of not giving a flying fuck what anyone thinks about you, and also not allowing anyone to disrespect you.
"You cannot become what you want because you're too attached to who you were." You need an identity shift. I'd recommend your read Atomic Habits by James Clear & Psycho-Cybernetics by Dr. Maxwell Maltz as they discuss this in more depth. Atomic Habits discusses how to form better habits and also how to make an identity shift. And Psycho-Cybernetics discusses the power of you subconscious mind, why you've developed certain thought patterns, and how to create new thought patterns.
I'm not saying this change will be overnight, and I'm not saying I'm perfect myself, I still deal with this today. But it's definitely possible to overcome this obstacle you're talking about. Message me if you ever want to talk.