Well, in some fanfiction, it could be a plot device to create a huge rift in the relationship between Sakura and other characters. If Sakura stabs Naruto, it would shock everyone. Maybe she was influenced by a dark power or an ancient curse that made her turn on Naruto. This would lead to a complex web of events where characters have to deal with the aftermath, both in terms of their emotions and the overall balance in the ninja world.
It could be that Naruto has lost his sanity temporarily. The stress of being a hero, the constant battles, and the losses he has endured might have taken a toll on his mental state. In this state of instability, he may see Sakura as a symbol of something he wants to preserve or protect, but his way of doing so is through kidnapping. Or there could be a new villain in the story who has the ability to make Naruto act out of character, and this villain's plan involves Naruto kidnapping Sakura.
One possible motive could be mind control. Maybe an enemy uses some kind of jutsu to make Naruto lose control and attack Sakura. Another could be a misunderstanding. For example, if Sakura was framed for something really bad, and Naruto in his hot - headedness believes it and attacks her. Or perhaps in a dark, alternate universe version of the Naruto world where the characters' personalities are twisted, Naruto might have a reason to attack her based on that altered personality.
It could be due to a dark influence. Suppose she was under the influence of some dark magic or an evil force that made her lose her true self and turned her against Naruto. This could lead to her almost killing him in the fanfiction.
It could also be a matter of desperation. Perhaps there is a threat to the village or someone she loves dearly, and she believes that Naruto holds the key to solving the problem. But instead of asking him directly, she kidnaps him in a hasty and ill - conceived plan. This could lead to a lot of drama and character development as Naruto tries to understand her actions and they both work towards resolving the real issue.
One possible motive could be jealousy. Maybe Naruto has achieved something that Sakura desires, like getting more recognition in the village. So, she decides to frame him to bring him down a notch.
It could also be for the greater good of the community or world she lives in. If there was an impending disaster like a powerful demon about to break free and destroy everything, Sakura might sacrifice herself to stop it. She would see her own life as a small price to pay to save countless others. This shows her selfless and heroic nature.
One possible motive could be extreme jealousy. Maybe in this fanfiction, Hinata is insanely jealous of Sakura's relationship with Naruto or her skills, and that drives her to the unthinkable act of killing.
One possible motive could be to use Sakura as bait. Maybe Sasuke is trying to lure Naruto to a certain location. He knows Naruto cares deeply about Sakura, so he figures Naruto will come after her.
Perhaps in a fanfiction where the world has been completely turned upside down. If Sasuke had been tricked into becoming an unstoppable villain who was about to destroy the entire ninja world, and Sakura was somehow aiding him (maybe under a genjutsu), Naruto might feel he had no choice but to stop them by killing. Another reason could be a broken heart. If Naruto loved Sakura deeply but she constantly rejected him and chose Sasuke, and then Sasuke and Sakura betrayed him in some way, his anger and pain could lead to such a drastic act.
One possible motive could be to use Naruto as a bargaining chip. Itachi was a complex character with his own goals related to the safety of the Hidden Leaf Village in some ways. He might have thought that by kidnapping Naruto, he could influence the village's decisions. For example, he could try to stop certain actions the village was planning that he believed would lead to more harm. Another motive could be related to the Nine - Tails within Naruto. Itachi might have wanted to study or control the power of the Nine - Tails for his own purposes, perhaps thinking it could be a way to protect Sasuke in a different manner.