The driver's side manual locking button is both a switch and a mechanical connection to driver's side locking motor.
The button is directly connected to the lock mechanism itself and thus to the central locking motor.
The central locking motor contains a switch which detects the position of the locking mechanism. If this switch detects the mechanism being manually moved, it will also operate all 4 motors via the alarm / central locking ECU so the rest of the doors follow the position of the driver's door. The driver's side locking motor will also operate although not strictly necessary.
The only way the doors can be deadlocked is by the central locking motor. This cannot happen mechanically alone.
The central locking motor has 3 positions in contrast to the locking mechanism which has two: Fully upwards, it moves the locking mechanism into the "unlocked" position. In the central position, the mechanism can be manually moved between locked and unlocked. In the bottom position, it moves the mechanism into the locked position. If it remains in this position the door cannot manually be unlocked and is deadlocked.
Normally, the central locking motor moves into the central position after locking or unlocking the car so manual operation is possible, except if the car is deadlocked where it remains in the bottom position.
So, your driver's door lock is operated manually, the switch senses this and operates the central locking motors. In order to lock the door the central locking motor is moved into the deadlocked position, and then back into the central position which allows further manual operation of the lock. Except manual operation of the lock is not possible, which means the motor remained in the deadlocked position.
So yes, you're right in that the problem is electrical because this is the only way the door can deadlock.
Having said that, it's worth sitting in the car and trying locking it with the keyfob. If my theory is right this will also deadlock it on the first press.
I suspect your problem is in the switch that is used to centralise the position of the central locking motor.
Kevin