I had a 4 digit combination lock on my base gate. I successfully entered in the 4 digit code and it came off as normal.
I had 2 items on the ground, one of which was the combination lock. I spammed F button to pick both up quickly. In the meantime, I heard the constant clicking sound that occurs when you removed a lock off your fence. I assumed I still had the code lock.
I checked my inventory, and it was full of items, but the code lock was missing. It still made the clicking sound. I had to use the spare lock I spent 4 hours planning to build a 2nd gate, but now had to use it to secure my 1st gate.
When picking up items, if you have room in your pockets, jacket or backpack it gives 2 options:
Press F to pickup
Hold F to put in hand
I may or may not have had the option to Press F, despite having a full inventory. As such, it likely bugged and deleted the item since I Pressed F on it, but had no room in my inventory.