Zigbee Door Sensor Fails to Join Network, Stuck in Configuration Stage After Resetting and Re-joining with ZHA

It can of course always be a bug in ZHA (though that is a way less common occurence than you might think). Lets start with what exact Zigbee device product/model you have (preferably the full Zigbee signature, also known as Zigbee fingerprint)? There is a good chance to find more known issues if we know exactly that Zigbee device product/model you have as then we can do a search on the model and/or Zigbee signature.

If it is a battery-powered device and it is within range with no reception problems (and you have no issues with EMI/RMI/EMF interference) then it could be an issue that the device goes to sleep (i.e. a “sleepy device”) before it fully finishes the pairing process (initialization and interview). It is known that some sleepy devices can be tricky to pair and you sometimes manually have to keep them awake during the whole pairing process.

Regardless, at least some of the symptoms you describe are also normally seen when you have problems with EMI/RMI/EMF interference and when you do not have enough Zigbee Router devices (or a combination of those two root causes), as such you should not bother with troubleshooting any deeper or reporting any issues before you have first done everything you can to take all actions on recommendations and tips in this guide, as more commonly than not such symptoms will usually go away once you have just followed all those as best practice:

Only if you have already followed those all tips should you take the next step of reporting the issue, see troubleshooting section in the official ZHA documentation (which also contains summeries of those tips):

Note: FYI, ZHA integration issues should be reported to the Home Assistant core repository on GitHub:

PS: @luobenwang Kudos on a great first post! You are an IT-professional or developer I assume, or?