It sounds like what you're actually asking for is a way to disable the pressure plates, or switches that actuate the 'door'. If there are floor based pressure plates you can use actuated half blocks either side of the plates (on a separate color circuit). That way, when you 'lock' switch is thrown, you'll no longer be able to hit the open/close plate.
If you want to disable a switch/lever, it's trickier. You'd need to have a relay of some kind that is disabled (by your lock switch). Of course logic gates are perfect for this. But you could use a dart trap and a teal pressure plate as a relay/transistor, to send the signal to open the door. And an actuated block in there to disable the dart from passing through. But this will only operate once every 3.33 seconds.
Mine work fine still. Make sure there's nothing
at all in the way of the NPC's standing location, up to 3 tiles up.
View attachment 114333