It might be that in that particular fanfiction, the author was exploring different themes such as sacrifice on a grander scale. Harry Potter sacrificing himself to save the entire wizarding world in a more permanent way than in the original story. For example, perhaps the threat in the fanfiction was so great that his death was seen as the only solution to end the chaos and darkness.
Perhaps in this fanfiction, Harry didn't have the right items or knowledge at the crucial moment. The Elder Wand might not have recognized him as its true master, or he could have been betrayed by someone he trusted, which led to his death. Also, the magical world could have been in a more chaotic state, with darker magic being more prevalent and overwhelming Harry's defenses.
One possibility is that the Dursleys, out of their extreme hatred for anything abnormal, actively sought ways to harm Harry. They might have found some dark magic item or spell that they used against him, and without the proper protection or knowledge to counter it, Harry succumbed. In the world of fanfiction, there are many dark and creative ways to make this tragic scenario come to pass. For instance, the Dursleys could have made a deal with some dark forces, trading Harry's life for their own 'normal' life, and those dark forces would use powerful and insidious magic to end Harry's life.
The wizarding world would lose its 'Chosen One'. Voldemort would probably remain in power. Without Harry to oppose him, there would be no one to fulfill the prophecy. The wizarding world would likely be plunged into deeper darkness and tyranny under Voldemort's rule.
It can make readers view the original series as more fragile. Since Harry Potter is the main hero in the original, his death in fanfiction shows that the world J.K. Rowling created can be drastically altered.
One reason could be to explore the darker side of human nature. Even though Harry is a hero in the original series, fanfiction writers might want to see how he would be affected if he was pushed to his limits. Another reason is to create a more complex and controversial storyline. It grabs readers' attention as it goes against the normal perception of Harry.
Some fanfiction writers may have a different vision for Harry Potter's character. They might see him as more of a diplomat or a healer within the wizarding world, rather than a fighter. So, they write stories that reflect this different view of the character, where he uses his wits and other skills rather than engaging in physical or magical combat.
One reason could be that the official Harry Potter canon is so extensive and detailed that it overshadows fanfiction. The original story has such a rich world, characters, and plotlines that it becomes the main focus for many fans, leaving less room for fan - created stories.
One reason could be safety. Some fanfiction authors might think that Hogwarts is too dangerous for Harry, so they make him homeschooled to keep him out of harm's way.
One possible reason could be that he was injured during a battle with dark wizards. Maybe he was hit by a powerful curse that affected his legs. Another reason might be related to some kind of potion gone wrong. For example, if he accidentally drank a potion that had negative side effects on his motor functions.
One reason could be a reaction to the Ministry of Magic's mismanagement. In the original story, the Ministry often made mistakes and had corrupt elements. In fanfiction, this could lead to Harry becoming an anarchist as a way to oppose such a flawed system.