Have you removed the doors lately? If so, check for bent pins in the door connector. If not try both functions, lock and unlock, also there is a very small LED in the FOB above the buttons, look closely at the LED while grabbing the handle and pushing the lock button on the door, it should light up.
You could also swap the handles and caps from the passenger side to check if the handle has gone bad. If that doesn’t work it could be a broken wire in the door harness where it bends every time the door is opened.
Gregj
I also had this problem. It was broken wires in the door wire harness. ( like the above person mentioned.) it turned out that I had multiple broken wires inside the cloth wire harness cover. All in the same area. (Where it bends each time the door is opened and closed).
I had this on the passenger side. I had about 8k miles on it. They said some magnet was dislodged or something like that (at least, the paper did), they swapped the handle — and actually had one in stock. Took a couple hours.
I checked the obvious but nothing stood out so it was a quick warranty repair. In the handle itself.