if the door lock switch/wires/relays are shorted/grounded/broken or stripped wire, the system may think something is amiss and sense a turned off motor and key in ignition, hence the unlock mode whether you press lock/unlock.
another thing to think about, the switch maybe faulty and stuck in unlock mode all the time due to a shunted switch or maybe a metal object shorting the swtich into unlock mode.
im just guessing since i have never seen something like this in owning toyota's since the early 80's and going thru 10+ toyota vehicles.
about the nearest thing i have witnessed is a temp gauge i had to tap to make it jump from cold back to normal temp during long trips in the middle of summer. it was a faulty temp gauge.
you could try pulling the switch console on the armrest and using a meter test it and/or also using a jumper wire to test the switch. the switch assembly pops out kinda easy, at least my 98 seemed like it could.
maybe someone on the board can throw up a diagram of the 99 driver door switch assembly from the cdrom manual so you can see how the switches work. i think they are double throw switches so you could possible disconnect the wires and manually test the power leads to see of its the switch or the wires by using a jumper wire.
just some ideas to test.