It could be because of a dark power corrupting Sasuke. Maybe an ancient evil force takes over him and makes him see Sakura as an enemy. In some fanfics, this kind of external influence can completely change a character's actions. Also, it might be related to Sasuke's pursuit of power. If he believes Sakura is standing in the way of his ultimate power - seeking goal, he could be driven to kill her.
In some fanfics, a false prophecy could be the reason. If there is a prophecy that says Sakura will cause great harm in the future, Sasuke, being the person who wants to protect the village or the world, might decide to kill her to prevent that future from happening. However, this is all in the realm of fan - created stories and goes against the main Naruto storyline where they are comrades.
Perhaps Sasuke was testing Sakura's loyalty or strength. He may have thought that if she couldn't withstand his aggression, she wasn't worthy of being in his life. Also, his own inner demons, like the hatred he carried from his past, could have flared up and led him to almost kill her without fully realizing what he was doing.
One possible reason could be that Sasuke was under some kind of mind - control or dark influence at that moment. Maybe he was influenced by an enemy's jutsu that made him lose his sense of self and turn on Sakura.
One possible reason could be a sudden and extreme corruption of Naruto's character. Maybe he is influenced by some dark and powerful force that makes him turn against his friends. Another reason might be a misinterpretation of a prophecy or some kind of mind - control situation.
Maybe in a very dark and twisted fanfic, Naruto could be possessed by some evil force. This would override his normal sense of self and his love for his friends, causing him to harm them.
One possible reason could be Sasuke's focus on his revenge. His thirst for vengeance against Itachi might make him blind to Sakura's feelings and neglect her as he is constantly preoccupied with getting stronger to achieve his goal of revenge.
Maybe to explore different character arcs. The writer might want to see how Sakura would develop as a character if she strayed from her loyalty to Sasuke. It could also be a way to introduce new characters or relationships into the Naruto fanfic world.
Another reason could be a very dark and alternative interpretation of the characters. Maybe the writer has a different view of Naruto's character arc and how he could be pushed to the extreme. And they see Sakura as a character that could be sacrificed in this extreme version of Naruto's story. But this is a very far - fetched view considering the original story's development.
Perhaps they leave because they feel restricted in the village. They want to explore the world and grow as ninjas outside the boundaries and rules of the village. They might also want to learn from different ninja cultures and techniques that are not available in their own village.
Maybe in the fanfic, Sasuke has some personality traits that become more difficult for Sakura to handle over time. For example, his brooding nature might start to feel like emotional unavailability rather than just his usual self. This could lead to her regret.
Sasuke might believe that he's a danger to Sakura. Given his associations with dangerous elements and his own dark powers, he may feel that getting close to Sakura would put her in harm's way. Therefore, he rejects her to protect her. This is a common theme in many fanfics where Sasuke is portrayed as having a strong sense of self - sacrifice when it comes to Sakura.