Harold
To reproduce:
-Lock a chest with a key
-Lock the chest to the ground
-Select "Change Locks"
-Try to lock the chest again (seems to happen with the same or a fresh key)
It will not lock the chest, but the key will still appear to be in your inventory. On re-logging, the key is gone (I searched in the chest, in my inventory and containers, and under the chest). However, after re-log, now the chest can be properly re-keyed.
To avoid: after changing the locks, re-log, then re-key.