When holding something in your hands (e.g., a weapon), the default action on the inside of an unlocked digital codelock is 'remove lock' instead of 'lock'. The default action should be 'lock'.
Reproduction steps
Build a door, attach a digital code lock. With the lock unlocked, and something in your hands, attempt to lock the code lock.