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.
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 the way the Dursleys treated him. They were cruel, made him live in a cupboard, and constantly belittled him. This kind of mistreatment over the years could easily lead to hatred. Another aspect could be the lack of connection to his wizarding family that he was not aware of for a long time. He might feel angry at his parents for leaving him in such a situation without any real protection from the Dursleys.
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 a misinterpretation of his character. In the original series, Harry Potter doesn't hate Muggles at all. But in this fanfic, perhaps the author wants to explore a 'what if' scenario where something drastic has happened to make him have such feelings. Maybe he's been betrayed by a Muggle - in the fanfic world, this could be a made - up situation that sours his view on all Muggles.
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 misunderstanding. Maybe Lupin did something that Harry misinterpreted as betrayal or negligence. For example, if Lupin was forced to keep a secret from Harry for his own safety, but Harry found out in a way that made him feel deceived.
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.