Perhaps there was a misunderstanding. Maybe Sakura said or did something that they misinterpreted, and instead of talking it out, they chose to abandon her.
It could be jealousy. If Sakura has some special abilities or qualities that stand out, her friends might feel envious and decide to distance themselves from her. Another reason could be that her friends are influenced by some external factors. For example, a new group of people they want to fit in with doesn't like Sakura, so they abandon her to be part of that new group.
In the fanfiction, it could be that Danny's friends have their own problems to deal with. They might think that being associated with Danny is bringing more trouble into their lives. Maybe they get threatened by a new villain who warns them to stay away from Danny. Or they could simply be growing apart as they enter different phases of their lives and their interests no longer align with Danny's.
It could be due to outside influence. For example, an enemy of Sakura might have bribed or threatened her friends. Her friends, being weak - willed, then choose to betray her.
One possible reason could be jealousy. If Naruto becomes too powerful too quickly, his friends might feel overshadowed and abandon him out of envy.
One reason could be jealousy. Maybe Hermione has achieved something great in the fanfiction, like getting a top grade in a really difficult subject, and her friends are envious. Another reason might be a misunderstanding. For example, if she's been spending a lot of time with a new character, her friends could misinterpret it as her neglecting them.
One reason could be a sense of betrayal. Maybe he discovers some dark secrets about the village leadership that make him lose faith in Konohagakure. For example, if he finds out they were using him all along just as a weapon against other villages.
One possible reason could be jealousy. Maybe Naruto has achieved something great and his friends are envious. Another reason might be a misunderstanding. There could have been some false rumors or misinterpretations of Naruto's actions that led his friends to believe he wasn't trustworthy or a good friend.
One possible reason could be a misunderstanding. Maybe there was a miscommunication between Hermione and her friends, which led to them leaving her in the fanfiction. For example, if Hermione made a decision without consulting them, they might feel left out and decide to leave.
It could be a matter of loyalty being tested. If Hermione is accused of something she didn't do, and her friends don't believe in her innocence right away, they might leave her. In fanfiction, the author might be exploring the idea of how fragile friendships can be. Her friends could also leave if they feel that Hermione has changed too much, for example, if she becomes too strict or too obsessed with a particular project or cause.
One possible reason could be that she is forced to for some dark magic related plot. Maybe an evil wizard has put a spell on her that makes her think she has to leave to protect them. Another reason might be that she feels suffocated in her life with Harry and the kids, longing for her old adventurous self and thus decides to abandon them to seek freedom.
Perhaps he feels betrayed by the wizarding world. Maybe some of his friends turned on him or the institutions he trusted failed him. For example, if the Ministry of Magic wrongly accused him again, it could push him to abandon it all. He may also be haunted by the many deaths he witnessed and feels that leaving is the only way to escape the painful memories.