Hello, my name is Mark and I will try help you with this.
This is most likely to be a faulty lock motor or a fault with the wiring going the door.
You will need to remove the door trim panel and check the system with a multimeter to determine if it's the motor or a wiring fault.
The door locked when we got it last night when we brought the car car it home and would not lock after that
You still need to do the checks I said.