I think that if the rules want the GM to adjudicate, they could say so. Or they could use descriptions that are natural language rather than mechanical (like the notion of being "in the open" used in the "activities while travelling" rules).
I really think the Hermit background features illustrates how the rules could have been differently written, in a way that would - from my point of view - have been both (i) clearer and (ii) better.
Two things - first, while it may not be spelled out in great detail, there are numerous places, including the introduction, with statements like: 'One player, however, takes on the role of the Dungeon Master (DM), the game's lead storyteller and referee.' or;
'But the door might be locked, the floor might hide a deadly trap, or some other circumstance might make it challenging for an adventurer to complete a task. In those cases, the DM decides what happens, often relying on the roll of a die to determine the results of an action.' or;
In chapter 7 under Adv/Dis, "The DM can also decide that circumstances influence a roll in one direction or the other and grant advantage or imposed disadvantage as a result.'
I think the main difference is that some things - like those relating to the campaign itself like backgrounds, they are specifically calling out the need to consult with the DM - this is also referenced in the introduction: '...you should check with your DM about any house rules that will affect your play of the game. Ultimately the Dungeon Master is the authority on the campaign and its setting, even if the setting is a published world.
In most cases, the rules as written work well for things like stealth and hiding. But that doesn't mean that it will 100%, and that's what the DM is there for.
--
Second - while I'm sure we all can come up with ways to make the rules clearer and better (and I've given examples myself), ultimately there will always be room for improvement. Not that I don't think that the rules for hiding couldn't be handled differently, because they can be read as somewhat contradictory and scattered throughout the PHB. But Mistwell's point is a good one - the rules are there to try to help describe and adjudicate a specific situation. What's the situation, and what makes sense? Does it make sense that a character could potentially hide even when he is seen? If so, is it harder than it would normally be? OK, then he can attempt it, but with disadvantage.
If you're actually looking for a response to the NPC walking behind the wall - it's very situational, and you haven't provided enough information.
Does the rogue know the NPC is coming? Is there any place, ability, or possibility that the rogue can hide? Is there rubble, or pillars, or something else that might look like the rogue's figure in the fog? Is the rogue going to just wait there until the NPC walks into him, or is he trying to sneak around the NPC, or away from the NPC to remain hidden? Because my ruling would be different depending on those or whatever other situation that arose.
Are you wondering whether the rogue gains advantage if he attacks the NPC?
Here's one possible ruling - If the rogue is just going to stay where he is, there's fog, and he's intending to attack as soon as he can see the shadow of the NPC, then I would rule that the NPC gets a Perception check with disadvantage as soon as he's in a position where he could potentially see the rogue through the fog. Assuming the NPC doesn't succeed, the rogue is hidden until after his attack hits or misses, and the attack is with advantage. After that he's no longer hidden, although he's still obscured. The distance involved for this will depend on how thick the fog is.
Of course if there's fog, the NPC is also potentially hidden from the rogue. If the Rogue succeeds in his Perception check and discovers the location of the NPC, he's still unseen for some period. And once his form can be seen through the fog, he may not be able to determine that it is, in fact, the NPC. It could be one of his allies. So now the Perception check that the rogue makes may be to confirm (through body motion, sounds, weapon carried, etc.) that it isn't an ally. If the NPC is an human and the rogue and all of his allies are halflings, then this check wouldn't be necessary because it would be fairly obvious that the figure in the fog is an enemy.
These types of examples are helpful for learning how to DM, but also take up too much space in the rulebook. In the past these made interesting articles in Dragon. It wasn't uncommon for several articles to appear over the years with differing viewpoints. Nowadays, these are more frequently discussions on forums. Which in many ways is like a game all in itself.
Randy