Maybe in the fanfic, Beckett got a new job opportunity in a far - away place. This could make Castle think she's leaving him.
In the fanfic, there might be an external influence. Perhaps an old acquaintance of Beckett's came back into her life and Castle felt threatened and thought she was going to leave him for this person. It could also be that Beckett's family issues made her consider moving away, which Castle took as her leaving him.
It could be that there was some sort of misunderstanding. For example, Beckett might have been acting a bit distant because she was working on a dangerous case secretly and didn't want to involve Castle, but he misinterpreted it as her wanting to leave him.
He might be in denial at first. He could keep trying to convince himself that there's no way Beckett would leave him.
Maybe he saw Beckett spending a lot of time with another man without knowing it was for a case. Castle is a bit of a jealous type, and he might overreact to normal interactions.
It could be that Castle is overprotective. He loves Alexis so much that even the slightest sign of Beckett not being on the same page as Alexis in Castle's eyes makes him think Beckett hurt her. Maybe Beckett gave Alexis some career advice that Castle thought was too pushy.
In the fanfic, it could be that there are signs that Beckett is hiding something. Perhaps he has unexplained absences. He might say he's at work but Alexis can't reach him during those times. Also, he could be overly protective of his phone or personal space, which makes Alexis suspect that he's cheating.
One possible reason could be that they are on a secret mission. Maybe they are trying to protect a key witness or important evidence from a powerful and dangerous criminal organization. In the world of fanfic, this could lead to them having to disappear to keep their whereabouts unknown.
Jealousy could also play a part. Castle is often surrounded by beautiful and adoring fans as a famous writer. Beckett might start to feel insecure, especially if she sees some of these fans getting a bit too close to Castle. On the flip side, Beckett's dedication to her work and her male partners in the police force could make Castle jealous, ultimately leading to their break - up.
Maybe they stumble upon a government conspiracy. The government wants to keep something hidden and they are seen as a threat, so they are made to disappear. It could also be related to a scientific experiment gone wrong. They are in the wrong place at the wrong time and get caught in an energy field that transports them to an unknown location, causing them to disappear from their normal world.
Maybe he's afraid of losing her because she's his partner and they've been through so much together. Their relationship is very important to him.
Perhaps they are trying to protect their relationship from outside interference. For example, if there are people in Castle's publishing world or Beckett's police department who don't approve of their relationship, they could pretend to be separated to avoid any negative consequences. This would allow them to still be together in private while keeping up the appearance of being single in public. Also, it could be a way to test their relationship. They might want to see how they would fare on their own and if their feelings for each other are strong enough to withstand a period of 'separation'.
One possible storyline could be that Castle goes into a deep depression. He might isolate himself from his friends and family, constantly reminiscing about their time together. He could also become obsessed with finding out the truth behind her 'death', suspecting foul play and starting his own investigation, even if the official version says it was an accident.