Could well be a classic problem that being that one of the master locks, I.E driver or passenger door is "Sticky" and so when the pulse times out one of the locks is "Stuck in the middle" so it reverts to the state it was I.E open in your case. The mechanism/lock simply needs lubeing to sort this.
Martin