There really is no difference between selecting a NPC vs an object (e.g. chest, node). The NPC is really just another object. The behavior is the same. You are the one that chooses what is selected, not the server. So you are the one in control. This is how it should be. A selected object will remain selected so long as you remain within a certain distance of it or so long as the object remains in the game world. The object gets deselected only if you move too far from it or when the object gets removed from the game world.
With an ore node, if you empty it the node is deselected because the node is removed from the game world and it no longer exists. If you leave at least one item in it, it will act the same as the NPC because the node remains and exists in the game world. Even after closing the loot box the node remains selected because it exists in the game world.
With the NPC, when you are done talking to them they still exist in the game world and so they remain selected. However, if they move you to an instance or another region they will be deselected because you are no longer in range (or, they do not exist in the game for you as you are now in a different part of the game that does not include them).
The behavior is consistent no matter what the object is. I just click on the open ground to deselect them either while reading the quest dialogue (yes, I read the entire thing) or as I move away from them. It's so much of a habit I don't even think about having to do it.
"Everyone's got one. Better to be a smart one than a dumb one." - me
"It's people like you that [I]think[/I] you know everything that give those of us that [I]do[/I] a bad name." - me
"Eat, drink, and be Merry, 'cause Pippin was a fool of a Took."