What happens if you simultaneously lock both doors together?
I have seen it where a wire between the lock actuators has broken so locking the drivers door didn't lock the passengers door, which subsequently re-opened the drivers door again (and vice versa).
In this particular instance (ford KA), the broken wire was in the plug where the door wiring loom connects to the socket on the car bodywork.