It could also be that the fanfic portrays his parents as having been neglectful in some way. For instance, they were so focused on the fight against Voldemort that they didn't leave behind enough emotional support or guidance for Harry in the form of memories or letters. This lack of connection could lead to Harry's hatred.
One possible reason could be that in the fanfic, the author might twist the story to make it seem like his parents' actions had unforeseen consequences that affected Harry negatively. For example, their fight against Voldemort led to Harry being an orphan and having to bear a great burden from a young age.
One possible reason could be that he might feel abandoned. Growing up without them, he could resent the fact that they left him an orphan. He might think that if they were really so great, they would have found a way to survive and be there for him.
Maybe they were forced into it by some dark magic or a powerful dark wizard. They could have been blackmailed into betraying Harry to save their own lives or the lives of others they cared about.
It could be that Harry finds out about Dumbledore's secrets regarding the Deathly Hallows. If Harry thinks Dumbledore was more interested in the Hallows for his own purposes rather than for the greater good, it might make him hate Dumbledore.
One possible reason could be to explore different parenting styles in the wizarding world. Spanking, although a controversial form of discipline, might be used by some writers to show how Harry's parents could have dealt with difficult situations. Another reason might be for shock value or to create a unique and unexpected story within the familiar Harry Potter setting. It could also be a way for the writer to delve deeper into the characters' personalities and how they might react in a situation that involves discipline.
Perhaps in this fanfic, Harry has been influenced by dark magic or some evil entity. This external influence could distort his perception of Lily and turn his normal feelings for her into hatred. Dark magic has the power to corrupt one's mind and change relationships in unexpected ways.
One possible reason could be the betrayal he faced from some people in the wizarding world. For example, some students at Hogwarts might have spread false rumors about him or treated him unfairly because of his fame as 'The Boy Who Lived'. This could have led him to develop a general dislike for humans.
One possible reason could be that in the fanfiction, her parents might have made a sacrifice that left her alone, and she resents them for not being there for her. Maybe she feels abandoned and that has led to her hatred.
One possible reason could be that he discovers some long - hidden family secrets that make him question his parents' actions or decisions. Maybe he finds out about some dark deeds in their past that he can't overlook.
One possible reason could be a misunderstanding. Maybe he discovers some secrets about his parents that he misinterprets. For example, if he finds out they were involved in some dangerous or morally ambiguous activities in their youth that he doesn't fully understand at first.
One possible reason could be a miscommunication. Maybe Hermione accidentally reveals a secret of Harry's that he didn't want known, and this causes him to feel betrayed and start to hate her. Another reason could be jealousy. If Hermione gets more attention or praise for her magical abilities than Harry in the fanfic, he might develop feelings of envy and hatred. Or perhaps there's a love triangle situation where Hermione is involved with someone Harry doesn't like, and that causes his hatred.