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.
He might react with jealousy. He could glare at Josh and then give Beckett a hurt look before storming off.
He might get jealous right away. He could storm off and then later come back to confront Beckett about it.
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.
He might be in denial at first. He could keep trying to convince himself that there's no way Beckett would leave him.
He'd probably be shocked. Just freeze in place for a moment, not believing what he's seeing.
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 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.
One implication could be that Castle might become jealous. This could lead to some tension between him and Kate.
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.