IME it's not a problem with NPCs the PCs aren't expected to fight; it's a problem with the Darth Vader type antagonists who show up & fight the PCs. It's occasionally a problem with Mary Sue NPCs who the PCs are expected to accompany on their awesome adventures.
The general principle is never give plot immunity to NPCs, always adjust the plot if one meets an unexpected demise. Luckily since the 1990s ended this seems generally accepted.
Except in Elder Scrolls....
In Morrowwind, it seems you could kill anybody, at any time. Which led to quests you couldn't finish, etc. Since the game couldn't adapt to that, that could be pretty disruptive to the world in general (especially as the player slowly wiped out the town).
By the time we get to Skyrim, they added the immortal NPC concept, where some NPCs would have the Take a Knee concept.
Which sometimes is also jarring, but is also nice sometimes for not losing favorite NPCs companions.
It seems like sometimes the idea has merit, sometimes it does not. Maybe it's also a case of not setting up situations where it becomes a problem. Consider:
annoying NPCs make me want them to die (thus exposing that they are plot-protected)
Escort missions usually setup the NPC to get killed
Glass jaw or incompetent NPCs that race towards danger
So whether an NPC is plot-protected or not, maybe a GM should avoid situations that make it a noticeable problem. In Skyrim, there's a patch that makes NPCs run away from vampire raids. Because the original code was stupid and had NPCs rushing to get themselves killed. In D&D, non-fighty NPCs should be competent at avoiding fighting
