One possible reason could be the overwhelming burden of his destiny. Constantly facing dark forces and the pressure of saving the wizarding world might have worn him down. Another reason could be the loss of his loved ones. For example, if in the fanfiction Hermione or Ron were killed, that could shatter his spirit.
In this fanfiction, perhaps he lost his will to live due to a sense of failure. If he made a big mistake, like accidentally releasing a powerful dark magic that caused great harm to the wizarding world, the guilt could be crushing. Also, if he was betrayed by those he trusted deeply, it would be a huge blow to his mental state.
One possible reason could be the continuous loss of his loved ones. In the original series, Harry has already endured so much pain from losing Sirius, Dumbledore, etc. In the fanfiction, perhaps there are additional deaths or betrayals that push him over the edge. Another reason might be the overwhelming burden of being 'the Chosen One'. The constant expectation to save the wizarding world could finally break him.
Maybe he was hit by a powerful dark magic spell specifically designed to target the soul. Such spells in the Harry Potter universe can be extremely dangerous.
Perhaps he is betrayed by those he trusts. In the original series, there were instances of betrayal, and if in the fanfiction this is amplified, for example, if the whole wizarding community turns against him unjustly. He might feel so alone and hopeless that he loses his will to live. Also, if he discovers some dark secrets about his past that make him question his own identity and worth, it could lead to this state.
In the fanfiction, Harry Potter might live by himself because he is tired of the spotlight. After being in the public eye for so long, he desires a private life. He may also feel that living alone allows him to better understand himself and his powers. It could be that he has a prophecy or a personal quest that requires solitude. For example, he might be trying to master a very difficult and dangerous spell that he doesn't want anyone else to be in danger from if something goes wrong. Also, he could be exploring some dark corners of magic that the wizarding world might not approve of, and living alone gives him the freedom to do so without judgment.
In some fanfiction, Harry might renounce his name to explore a new identity. He has been through so much as Harry Potter, and by giving up his name, he can break free from the predefined roles and destinies associated with it. He could then embark on a journey of self - discovery, free from the constraints of the name that has both defined and haunted him.
One possible reason could be that in the fanfiction, Harry might have discovered some dark secrets about his parents that made him feel betrayed. For example, if he found out they had some hidden and unethical magical experiments in their past.
In some fanfictions, his family might be involved in dark magic or have a bad reputation. So, Harry Potter refuses them to uphold his own moral values. He is known for his strong sense of right and wrong, and if his family goes against that, he would distance himself.
One reason could be the extreme hardships the characters face in the original story. For example, Harry has lost his parents, faced Voldemort numerous times, and seen many friends die. In fanfiction, this could be amplified to a point where a character feels they have no will to live. Another aspect could be related to the sense of isolation. Some characters, like Snape, were always sort of alone in their struggles, and in fanfiction, this could lead to a loss of the will to live.
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.
Perhaps he discovers some secrets about his parents that he doesn't like. For example, he might find out that they were involved in some dangerous or unethical magic before. This new knowledge could make him angry at them for putting themselves and their family in jeopardy.