There could also be a sense of anger. Anger at whoever or whatever caused this to happen to Beckett. He might be angry at himself too for not being able to protect her, and this complex mix of emotions would make the identification process extremely difficult for him.
He would likely feel extreme shock. Just the sight of her body could send his mind into a tailspin. He might also be in denial at first, not wanting to believe that it's really her.
One challenge could be the state of the body. If it has been damaged or decomposed, it would be difficult to identify. Another might be the lack of proper identification tools or information at the scene. Maybe there are no fingerprints available or dental records are missing.
Castle might become obsessed with finding the truth about what happened. His writer's mind would start formulating theories and he would stop at nothing to get justice for Beckett, which could put him in dangerous situations.
He could become more withdrawn. Losing Beckett like that would make him hesitant to let people in again. He'd be more guarded, fearing another loss.
Castle could initially deny it's her. He'd look for any sign that it's not Beckett, checking for details that are off. As he realizes it is her, he'd break down, crying uncontrollably. His world would shatter because she was such an important part of his life, and he'd be filled with regret for any unsaid words or things they didn't do together.
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.
One possible plotline could be that the baby has some sort of special ability or is in some way connected to a mystery they have to solve. Maybe the baby's birth coincides with a strange series of events in the city, and Castle and Beckett have to use their skills to protect the baby and figure out what's going on.
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.
A Castle and Beckett baby fanfic could be about their journey into parenthood. It might explore how they adjust to having a baby in their lives. For example, Castle could be super excited and start writing new stories inspired by his new family experience, while Beckett might be a bit more cautious and protective.
In a fanfic where they have a baby, their relationship would shift. They would now be partners not only in crime - solving but also in parenting. Castle would likely become more domesticated, helping with diaper changes and midnight feedings. Beckett would have to learn to let Castle in more on the parenting front, and they would communicate more about family - related matters. This new aspect of their relationship would add a different layer of complexity and closeness to their bond.
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'.