Well, it could be that Beckett is in a parallel universe where he has a different life and he's in bed with another man. In this story, they could be discussing their different worlds and how they got there. Maybe Beckett is an undercover agent and he has to pretend to be in a relationship with this man, so they are in bed just to keep up the pretense for some important mission. It could also be a story about Beckett's past life where he had a relationship with a man that he's now rediscovering while in bed with him.
Another possibility is that Beckett is trying to make someone else jealous. In the world of fanfic, there could be a complex web of relationships. He might be using this flirting as a tactic to get the attention of another character, perhaps someone he has a more complicated relationship with, like an ex - lover or a rival.
It could also be a fanfic that takes place in an alternate universe. In this universe, the events of 4x23 didn't happen as they did in the show. Maybe Beckett didn't become a detective in the same way, and Castle meets her in a completely different situation. They then start to solve mysteries together in this new setting.
Add some mystery. For example, the man in bed with Beckett could have a hidden identity or a secret mission. This would keep the readers guessing and make the story more engaging.
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.
Perhaps the man is a new partner Beckett has been assigned to work with on a case. Castle sees them together and his insecurities get the best of him. He starts imagining all sorts of things, like Beckett replacing him in her life. However, in the end, it turns out that Beckett has no romantic feelings for the other man and Castle realizes he overreacted.
One possible plotline could be that Castle, in his over - the - top way, proposes something like a wild undercover mission where they have to pretend to be a couple in a very improper situation to solve a case. Beckett is initially shocked but then realizes it might be the only way to catch the criminal.
One possible plotline could be that Sakura is arranged to marry this other man for political reasons in a fictional kingdom. She might initially resist but gradually discovers his good qualities. For example, he could be kind to the poor and dedicated to making the kingdom a better place. As she gets to know him, she starts to develop feelings for him.
One possible plot could be that Beckett is kidnapped by a rival group who wants to use his skills or knowledge for their own gain. His friends then embark on a dangerous rescue mission.
Imagine a fanfic where Beckett is at a library. He notices a man looking for a book. Beckett, being the flirt he is in this story, offers to help. As they search for the book together, Beckett brushes his hand against the man's a few times on 'accident'. He also makes some flirty comments about how smart the man must be to be interested in that particular book. Soon, there's a definite spark between them.
One possible plot could be Beckett's intense search for the abducted child. She might use her detective skills to follow leads, question suspects, and piece together the mystery of the abduction. Another plot could involve the emotional journey of the people related to the abducted child, like the parents, and how Beckett interacts with them during the investigation.