He could react with anger. After all, if he has feelings for Beckett, seeing her with someone else like Vaughn might make him furious. He might lash out at both Beckett and Vaughn without really understanding the situation.
Another thing that could occur is that Castle decides to confront Beckett about what he saw. He could be really straightforward and ask her what's going on between her and Vaughn. This could lead to an argument or a really honest conversation about their relationship.
Your best bet would be to search on large fanfic platforms. Archive of Our Own (AO3) is a great place to start. Just go to the website, type in 'Castle' in the search bar, and then add keywords like 'Vaughn', 'Beckett', and'seeing a kiss'. Another option is Fanfiction.net. Navigate to the 'Castle' section and use the same kind of keyword search. There may also be some smaller, more specialized fanfic sites related to the show, but AO3 and Fanfiction.net usually have a wide range of content.
One possible plot could be that Castle sees Beckett with Josh and it makes him realize his true feelings for her. He might then start to compete for her attention in a humorous and endearing way, like writing a new novel inspired by his jealousy and love for her.
It's possible that there are fanfics like that out there. The 'Castle' series had a lot of complex relationships, and fans often create fanfics to explore different 'what - if' situations. But I haven't come across one myself that has Castle seeing Vaughn kiss Beckett. You might have to dig deep into the fanfic archives or ask in dedicated 'Castle' fan groups on social media platforms.
The plot could develop in many ways. For example, if it's a mystery - focused fanfic, Beckett's presence at the hotel could be linked to a big mystery. Castle, being a mystery writer, would be eager to get involved. They might start investigating together, exploring different parts of the hotel. As they do so, they could face various challenges and obstacles, which would bring them closer together. Along the way, they could also discover secrets about each other that they didn't know before.
One possibility is that Castle has booked the hotel for a romantic getaway by himself, and seeing Beckett there completely throws him off. Beckett could be there for a much more serious reason, like following a lead on a dangerous criminal. Castle may start to worry about Beckett's safety and decides to stay close to her. As they interact more within the hotel, they might realize how much they've missed each other's company, and this chance meeting could be the start of something new between them, whether it's a new level of friendship or a re - awakening of their romantic feelings.