When picking up a used code lock, you will randomly hear the "unlocked code lock" sound after a while, and repeadetly.
It happens whether you have the lock in your hands or in your inventory.
From a little testing it seems like it only happens to codelocks that have been used, not to ones picked up from a spawn location.
People around you can hear the sound as well.
In the video you can see me putting in the code, picking up the code lock in my hands . The sound appears at 00:07 . Then I put the lock in my inventory, and the sound appears again around 00:54 . It will go on until you apply the lock to the gate again.
This was in the latest 1.13 exp patch on a server without mods. It happened in 1.12 as well.
I am not sure if it happens with 3 digit code locks as well, as I couldnt reproduce it on a 1.12 testing server. Maybe the time the lock is on the gate matters, or a different person needs to put the lock on?