It could be that they lied to Harry about something really significant. In the wizarding world, trust is built on truth - telling. If they told a big lie, like about the true nature of a magical object that was putting Harry in danger, he would be very angry. And if their actions led to the death of someone Harry cared about. For instance, if they made a wrong move during a fight that caused an ally to die, Harry would find it very hard to forgive them.
In the fanfic, Hermione might regret choosing Ron over Harry because Harry has a different level of understanding when it comes to her academic pursuits. Harry, having faced the challenges of fighting Voldemort from a young age, might have a deeper respect for Hermione's thirst for knowledge and her need to constantly learn and improve. Ron, on the other hand, sometimes showed impatience with Hermione's studious nature.
It could be due to a misunderstanding. Suppose Ron overhears a conversation between Harry and Hermione that he misinterprets completely. He might think they are plotting against him or don't really consider him a true friend. So in a fit of anger and hurt, he decides to betray them.
It could be a misunderstanding. For example, Ron might think Harry did something really bad to Hermione or their other friends. Without proper communication, his anger could lead him to punch Harry. Also, if there was some sort of magical influence or dark magic at play that affected Ron's judgment, that could be a reason too.
Well, perhaps in the fanfiction they leave because of a prophecy. A prophecy might state that their presence near Hermione would bring great danger to her or to the wizarding world as a whole. So, they sacrifice their friendship and leave. Also, it could be due to some dark magic influence. They are forced by a powerful dark magic spell to stay away from Hermione, not having control over their actions.
One possible reason could be that they are wrongly accused of a serious crime within the wizarding world. Maybe some dark magic items are found in their possession and the authorities suspect them of being involved with dark wizards, without fully investigating the real source of those items.
One reason could be envy. Hermione is often very good at academics and magic, and Harry and Ron might be envious of her success. For instance, if Hermione always gets top grades in potions class while Harry and Ron struggle, they could lash out at her out of frustration.
One reason could be jealousy. Maybe Ron feels that Harry is getting too close to Hermione and he's afraid of losing her attention. In fanfiction, authors often play with the characters' emotions. Harry, on the other hand, might see Ron as being too possessive of Hermione.
Well, it could be related to Ron's insecurities. He might be insecure about his place in the group with Harry and Hermione. Hermione is always so confident and sure of herself, and Ron might feel that he doesn't measure up. This could translate into aggression as a way of lashing out. Also, perhaps there's some external influence, like a dark magic object that's affecting Ron's mood and behavior towards Hermione.
One possible reason could be a misunderstanding. Maybe Harry overhears Ron and Hermione having a private conversation where they seem to be critical of him in some way, but they were actually just worried. Another reason might be if Harry starts to pursue a very different path in magic, like dark magic perhaps, and Ron and Hermione can't support or be associated with that. It could also be that a new character comes into their lives who tries to drive a wedge between them by spreading false rumors about each of them to the others.
It's possible that Harry hates it because he has a certain image of Ron and Hermione in his mind. Fanfiction can sometimes create versions of them that are completely different from what he knows. For example, some fanfiction might focus on a love triangle that he doesn't think exists in their real relationship. This divergence from his perception could lead to his dislike.