How do I completely reset an NPC?

Solution 1:

If none of the other suggestions are working you might have to try spawning an entirely new instance of Lydia. Go wherever you want Lydia to consider home and use a player.placeatme command. (Maybe consider killing or disabling your old instance of Lydia after if this works.)

Note: I'm not entirely sure, but you might have to reset your relationship stats with the new Lydia too.