When you have lockpicks equipped, any new ones acquired are added to that stack, rather than to the inventory.
Viewing post in The Exiled Demon Prince comments
Somehow I made a big mistake and accidentally gave the lockpick and the pendant the same ID. This causes a problem because the game treats items as the same if their IDs match. It doesn’t check the item’s name, stats, description, or anything else because that would be too slow if player has a lot of items in his inventory,so it only checks the ID.
That’s why when you bought the lockpick, it looked like it disappeared. What actually happened is that the game thought you already had a lockpick equipped (the pendant) and tried to increase its amount. However, since the pendant isn’t a stackable item, increasing its amount does nothing. As a result, it looked like the lockpick simply disappeared.
As to why it still worked when you unequipped the pendant(but didn't sell it). Since the game assumes every item has a unique ID, when you buy a item of certain type - in this case "tool". It only looks for matching ID in the tool tab of the inventroy. Since the pendant belongs in the equipment tab, it didn't find a matching ID and gave you the lockpick normally.