Perhaps in the fanfic, there was a magic - based war that Harry was forced to fight in. He witnessed so much destruction and death caused by magic that he lost faith in it. Also, he might have been betrayed by a fellow wizard using magic in a deceitful way, which made him question the goodness of magic.
One possible event could be that a powerful dark magic spell was cast on someone he loved, and he couldn't reverse it. This would make him see magic as a dangerous and uncontrollable force, thus leading to his hatred. Another event might be that he was wrongly accused of using dark magic, and the whole wizarding community turned against him because of it.
It's possible that he hates it because in fanfiction, his friends and he himself might be portrayed in ways that are completely different from who they really are. For example, Hermione might be made into a silly character instead of the intelligent and brave witch she is. This distortion of the people he cares about could be a big factor.
He might avoid any events or communities related to magic fanfic. He won't be interested in reading or discussing them.
One reason could be a personal betrayal. Maybe a close friend from Gryffindor betrays Harry, and this makes him start to dislike the whole house. It's like when one bad apple spoils the bunch in his eyes.
Perhaps there was a miscommunication. Sasuke might have said something that Sakura misinterpreted. Let's say he was trying to be protective but came across as overbearing. Sakura, feeling her independence was being challenged, chose not to speak to him as a form of protest. And in the context of the fanfic, this miscommunication could have been magnified by other plot elements.
One possible reason could be jealousy. Maybe Albus feels overshadowed by Harry's fame and achievements. Another reason might be some misunderstanding between them. For example, if there were miscommunications or false rumors spread about Harry that Albus believed.
She might give him harsher punishments than other students for the same offenses. For instance, if Harry is late to class, she could give him detention while letting others off with a warning.
One event could be if Tsunade refuses to help Naruto save one of his friends. Naruto is very loyal to his friends, and if Tsunade stands in the way of him rescuing someone dear to him, it might cause him to hate her. For instance, if she thinks the mission is too dangerous and not worth the risk for the village, but Naruto sees it as a matter of life and death for his friend.
In the fanfic, it could be that Kami has a conflict with one of Naruto's allies, and Kami's actions against that ally make Naruto angry and lead to his hatred. For example, if Kami tries to punish Naruto's friend for no good reason, Naruto would not be happy with Kami at all.
To adapt to Fairy Tail magic in a fanfic, Harry Potter would face quite a challenge. First of all, he has to get used to the more flamboyant and often physically - manifested forms of magic in Fairy Tail. In Hogwarts, magic is more about incantations and wand movements. But in Fairy Tail, there are all kinds of magic that are expressed in more dramatic ways. He would need to make friends within the Fairy Tail world quickly, because friendship is a key element in using their magic effectively. He could start by learning simple spells or magic types, like the basic elemental magics. And he'd have to learn how to work in a team, which is something that Hogwarts doesn't always emphasize as much as Fairy Tail.
Obviously, Harry Potter himself could be one of the main characters. He has a lot of untapped potential in terms of family magic that could be explored. For example, delving deeper into the magic he inherited from his parents.