And I am not arguing that rolling to check is an invalid approach or that it thwarts sandbox play. My only point is the GM deciding something like an NPC trait and that happening to establish a barrier to something in game, isn't railroading and is still in keeping with a player driven sandbox as people like me and Rob are describing (and I am not even saying all such sandboxes will avoid things like having the player make a skill roll: I just think there is often a reluctance to engage with strong social interaction rules in such campaigns).
I think the ethos behind it is very much at odds with player-driven play. As I've said multiple times, one instance may not impact play to the point that it's an issue. The more it happens, the more of an issue it's likely to be (again, assuming player-driven play is a goal). So to me, seeing such an unconcerned attitude is surprising.
I would expect a proponent of player-driven play to be very aware of this kind of thing.
Then I'm confused. There have been numerous posts about the guard scenario which describe how players can learn that information. In your words, they are able to discover it.
So what is the issue?
It depends. The example as provided is incomplete, so it's hard to say. This is why I've offered a few ways to handle it, depending on the circumstances.
For me, if player-driven play is a priority for me, I would have the trait of the guard be known. I'd either show the players in some way, or I'd let them know it. This is assuming the guard is not meant to be a meaningful obstacle in and of himself, but rather a step toward a more meaningful goal. I'm not going to spend a lot of time on such an interaction and just getting it to the point where it's actionable by the players.
Now, if we're talking about the resolution of a major goal... like if after the guard the PCs are speaking with the noble of the castle, and are pleading for help... then the noble's traits are much more important. I may require the players to try and suss them out. Or I may share them openly... it depends on the nature of the PC and other factors as well. The dealing with the noble seems far more central to the goal that the players have, so I would spend more time on it.
But even 5e has actual rules for that. The players can use skills to determine the NPCs Traits which will help them in negotiating with him. Most people ignore these rules, and the new version of 5e probably got rid of it altogether (I honestly don't know). But even a game that's as "hey, do what you want" as 5e has rules related to this stuff.
Sometimes hidden information leads to more engaging gameplay. A mystery campaign, for example.
Such is your opinion. I have played games where the resolution of a mystery is generated in a different way than just being pre-determined by the GM, or where the resolution of the mystery is secondary to the goal of play. Playing through a GM's novice mystery novel isn't my idea of an engaging way to play, generally speaking.