Why can I put locks on some doors and not on others?

I’ve tried reorienting doors, putting newer stone slabs next to them thinking that might be the reason. I just can’t install a lock on some of the doors and I have no idea why.

Edit: I do know that the door needs to be closed.

Wait, I may have been an idiot the whole time…

Okay so I did indeed do a dumb. For posterity, I will say that I forgot to use the file on duplicate lock and key.