One possible reason could be extreme self - sacrifice. Maybe he believes that by stabbing himself, he can save his friends or defeat Voldemort in a very unique way. For example, if there is a dark magic spell that can only be broken by his own life force.
Well, perhaps in that fanfiction, there was a prophecy that was misinterpreted. Harry thought Snape was the key to a great evil about to befall the wizarding world. Also, it could be that someone Harry deeply cared about was seemingly killed by Snape's actions (even if it was a false perception), and his anger led him to this extreme.
One possible reason could be heartbreak. If Harry was deeply in love with Hermione and she chose someone else, like Ron, the pain of rejection could be too much for him to handle. Another reason might be if Hermione betrayed Harry in some way, like revealing his secrets to the enemy. This sense of betrayal could shatter his trust and push him to the edge.
Another reason could be a build - up of years of pent - up anger and frustration. Snape has been harsh on Harry throughout his years at Hogwarts. Harry has had to endure Snape's unfair treatment, and all of that negative emotion could explode in a moment of extreme stress or danger, leading him to stab Snape.
Maybe in the fanfiction, Molly was being overbearing. Harry might have been frustrated with her constant interference or mothering in a particular situation.
Well, it could be that in this fanfiction, Snape is written in a way that endangers Harry's friends. Harry is very protective of his friends, so if Snape is portrayed as harming them in some way, Harry would likely try to destroy whatever it is that's causing the threat. Also, it could be related to some prophecy or hidden knowledge in the fanfiction that makes Harry believe Snape has to be stopped.
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.
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.
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 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.