Power door locks

I have a 2003 Lexus GS 300 with 83000 miles. My driver’s side rear door often does not lock when I lock the doors–either with the remote, the door lock button inside, or automatically when the car is in gear. Why would three doors lock and one not, and why would this only happen most of the time but not all of the time? What could be wrong/cost?

Possible loose or corroded wire or poor lock actuator connection.

Another is there may be a partially broken wire where the wires go from the door to the door pillar.