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.
In the 'Harry Potter can't walk fanfiction' when Harry loses his ability to walk, the story could develop in a very emotional way. His friends and allies would be determined to find a way to restore his ability to walk. Meanwhile, Harry himself might start to see the wizarding world from a different perspective. He may notice things that he overlooked before when he was able - bodied. He could also become a symbol of perseverance for other students who are facing difficulties. The story could also involve Harry learning to use magic in new ways to compensate for his lack of mobility, such as using telekinesis spells more effectively.
Harry might walk away because he has a new mission that he can't share with others. He realizes that to protect the wizarding world in a more fundamental way, he has to go it alone. So, he quietly walks away from his normal life to pursue this unknown and dangerous task.
Maybe he got injured during a dangerous adventure. For example, he could have fallen from a great height while chasing a dark wizard and broken his legs.
Well, his friends might rally around him. Hermione would probably start researching every possible spell or potion to help him. Ron, on the other hand, would be there to offer moral support and practical help like getting Harry around. For instance, he could use a levitation charm to move Harry from place to place.
It might be that Harry Potter values the authenticity of their story. Fanfiction can be all over the place with different plotlines and characterizations. He may feel that the fan - made stories about Hermione don't do justice to their real - life (in the wizarding world) experiences together. He's used to their real interactions and growth, and fanfiction might seem like a strange and wrong version of that to him.
One possible reason could be that he was severely injured in a battle. Maybe he got his legs broken or had some internal damage that affected his ability to move them. For example, if he fought against a really powerful enemy who used a jutsu specifically targeting his legs, it could leave him unable to walk.
It means that 'Harry Potter' is an original work, not a piece of fan - created fiction based on the Potter concept. It has its own unique world - building, characters, and storylines that were created by J.K. Rowling from scratch.
Maybe in some fanfictions, Molly Weasley is portrayed in a way that goes against Harry's perception of her. For example, if she is overly controlling or interfering in a much harsher way than in the original books, Harry, as a character who values his independence, might not be able to stand it.