That doesn't seems to be something that the engine can do (or it's bug and it should do it). If it's not a bug, the only way you could do that is by switching your npc to an event with the npc's sprite and set it as 'ignore npc avoids' when the door is open.