Playing around with the system I do notice a couple of things.
- Installation is very quick
- Dropping lock to inventory during installation does not abort installation
- Dropping lock to *ground* during installation does not abort installation
- Pressing esc during installation first closes windows and shit, and only last aborts installation
I have, however, also concluded that successfully aborting installation -- an "easy" way is to move the player, but do note that the first map click will be spent dropping the lock, which does not abort installation -- does not overwrite the old key binding, but rather leaves the old key correctly working, and the new lock correctly uninstalled. Aborting, thus, seems to work properly if you manage to do it.
I am thus going to venture a guess that your smith did indeed manage to overwrite the lock through the successful installation of a new lock, and one of my reasons for believing this is that; unless he was very prepared for what was going down, and had established those things I now established, I kind of doubt that he would have had time to successfully abort the process. How he now lacks the proper key is a better question, but he could perhaps have misplaced it. Has he gotten rid of any keys or somesuch?
Arguably, a lot of the things I have identified should be fixed. The process should be slower, and dropping the lock to inventory or ground should definitely abort the process. I have made notes to fix those things, and perhaps that is the best we can hope to get from this bug.
If my theory doesn't check out I have no idea what happened, and can only advise you to tear down and rebuild.
I have no further venues of investigation, and would need more meat to call this a bug, or investigate further.
If you have nothing more to add, I thank you for the report.