It is probably the lock actuator. My previous truck had the same problem in reverse. It would unlock via the switch just fine, but it wouldn't lock. I had to lock it manually, which was annoying until I turned off my auto unlock all with ignition turn off feature.
Just saying it happens, and can affect the actuator in only one direction.