No one said anything about "walking up to the gates". The just said the went into the castle, and there are many ways a PC might try to get into a castle, and when I asked for clarification, all I got was a snarky response. That's a bad faith player, refusing to engage properly with the game. Not only are they stabbed, they are out of the game. No one gets to be snarky, because that isn't fun for anyone other than the snarky player.
If, rather than saying "I go into the castle and see the king" (intent, not an action), they had said "I walk up to the castle gate and ask to see the king" (action), they might have been turned away, the might have been admitted, they might have been asked for a skill check, depending on the situation.