Unable to delete lock codes?

That can happen for a variety of reasons including the one Garrett mentioned. What is implies is that the underlying mesh is losing packets. I would recommending this topic which will help you reduce the chances of some of these issues happening in future: FAQ: why would I need another beaming repeater if my zwave lock is already close to my hub?

The smart locks app is a basic app with limited capabilities. You’ve seen an example of it not being able to identify if there’s a problem with lock packets in the mesh. If you’re looking for something hardier with the ability to identify mesh issues and compensate for them including tracking code programming, creating expiration or scheduled codes, custom notifications/actions etc, check out the Lock User Management (LUM) app: