a lot of people in fandom conflate "bad things happening to a character within the text" with "the character being mistreated by the narrative" and a lot of people conflate that with "the showrunner/author/creator hating or not caring about the character".
but bad things can happen to a character as part of their organic character journey. marcy wu from amphibia, for instance, is not mistreated by the narrative; she is given a full, complex arc. the stabbing + possession by the core are part of that arc. they do not detract from it. having her learn an actual lesson from her mistakes and not be handed everything she wants on a silver platter was also good for her arc, actually. she would not be half the amazing character she is if she had just stuck around being the same old marcy in season 3 and then chosen to stay in amphibia forever (???).
and buffy summers of buffy the vampire slayer fame is literally the main character in a show entirely about the hardships of growing up. of course bad things are going to happen to her, that's what happens when you grow up...the only bad thing that happens to buffy that does not add to her arc is the attempted rape in "seeing red". which is significant to be fair but it's also only one writing choice in seven seasons' worth of television. her boyfriend turning evil in season 2 is not her being "punished for having sex", it is about how sometimes when you are a teenage girl your boyfriends will turn out to be abusive and you have to learn to trust and rely on yourself and not blame yourself for their behavior.
or take derek hale from teen wolf, a character with a powerful and triumphant arc about healing from trauma and choosing not to let the past define you and thus rejecting your destructive quest for power and revenge as embodied by your evil uncle and reclaiming the positive legacy of your family as embodied by your mother instead. except according to some people, he is horribly mistreated by the narrative because sometimes bad things happen to him. at least half of these bad things, by the way, are consequences of his own damn actions. the other half are either part of his backstory or are obstacles put in his way on his journey to becoming a better person. which happens to every major teen wolf character so like. what do you expect lol.
and even when characters are genuinely mistreated it does not mean the writers hate them. for example regina mills from once upon a time was the subject of racist and misogynist writing choices and was held to unfair double standards by the narrative, which often demonized and punished her while rewarding white characters and male characters for similar or worse behavior. but she was also blatantly the creators' favorite character and it would be absurd to pretend otherwise. sometimes writers don't treat their favorite characters well or don't think through the implications of their choices...it doesn't mean they hate the character. come on now