Replacing a lock allows you to use the wrong kind of lock on items. I have tested it with large carts, wagons and chests.
Steps to reproduce:
1) Lock the object with a lock as normal.
2) Use a door/gate lock with the item to replace the lock. (Use replace lock option).
3) The door lock/gate lock will be used to replace.
You must use the replace lock option. Gate locks and Door locks will go in any of the above mentioned items. It doesn't seem to work on boats but I havent done extensive testing on it.