Device unavailable in HA after re-pairing in Zigbee2MQTT

Tags: #<Tag:0x00007f3268b84920> #<Tag:0x00007f3268b844e8> #<Tag:0x00007f3268b84290>

I have multiple Tradfri GU10 lights in HA with the Zigbee2MQTT add-on and they all were working fine for a couple of months. This week one of the lights started to become unavailable in HA and in Zigbee2MQTT. I tried by restarting HA and Zigbee2MQTT, rebooting my server and powering on/off the light but no luck.

Then I decided to re-pair the light in Zigbee2MQTT and change the friendly name in devices.yaml to the convenient name I used earlier (tradfri_basic_spot_1). After a restart of Zigbee2MQTT, the light started to work again in the Zigbee2MQTT Web UI. In HA the device is recognized in the MQTT integration but all entities are unavailable.

Then I tried by deleting the device in HA and changing the friendly name to something different in devices.yaml (tradfri_basic_spot_01 <-- note the changed numbering format) and to my surprise the entities became available in HA.

I was wondering if someone knows why this is happening and how I can use the original friendly name again (tradfri_basic_spot_1). Although I got it working again, for me it is convenient to use consistent friendly names. Is there some cache file I need to clear or obsolete device list that I need to clean up?