The game rules ARE the setting! They have to be, otherwise all you've got is an inconsistent mess.
You have not demonstrated this claim to be true.
Joe the farmboy heals like a peasant one night but the next day takes up a sword and starts adventuring, so the next night Joe the adventurer heals like an adventurer. Which means that yes, something about Joe changes the moment he leaves the farm.
Before Joe the farmboy started adventuring, he was not a character being played in the game of D&D, so the question of how he healed before he took up adventuring is one of narrative, not game mechanics.
OK, let's say he's a retired PC. (not that it should matter in the least!)
It doesn’t. What matters is whether or not his HP, its loss, and its recovery is relevant to the game. And if he’s not adventuring, it isn’t.
Also, don't forget that not all adventurers are PCs! There's party NPCs, other adventuring parties (be they friend, foe or neither), etc., etc.
True, NPCs that are adventuring with the party do need mechanics to handle their HP and its loss and recovery, and it does make the most sense for that to be treated the same way that it is for the PCs.
As a game purely in the game-first sense, perhaps; but I've got a computer if that's what I want. As a device for producing both a setting and a fiction consistent with itself this aspect of the system barely works at all (in any edition; though 4e-5e are a bit worse than the rest).
See, I have a computer if what I want is a game where everything that occurs is the result of a detailed rules engine that executes functions with absolute consistency. If I want a game that is adaptable and can respond to infinite possible variables, I turn to D&D for that, and a too-rigid rules system gets in the way of that.
Whether it comes up in the run of play or not is absolutely irrelevant; it's still going on in the background...or at least for the sake of consistency and believability the players have to think it is; and the easiest way to achieve that is to make it so.
Yes, in the background, the character recovers from his injuries in an appropriate amount of time. That doesn’t need to be governed by game rules though, because it isn’t part of the game. It is part of the narrative, and can (and should) be governed narratively.
True, though as h.p. are always what you lose when something hurts you one would think they'd also be the go-to mechanism to represent injury.
They’re always what you lose when you get Hit with an Attack (that is to say, when an opposing creature’s Strength or Dexterity + weapon Proficiency Roll meets or exceeds the character’s Armor Class.) That doesn’t have to mean narratively that the character was hurt, and in fact it shouldn’t if that narrative leads to a narratively nonsense outcome, such as the character recovering from that injury in an illogical timeframe.