Issue with Azure Device Registration - Number of retry attempts exceeds expectation Error

Please follow the below steps,
Run the following command ”dsregcmd /leave” in an elevated command prompt and restart the device to attempt to rejoin the machine.
If it still not working then go to Task Scheduler Library > Microsoft > Windows > Workplace Join > Automatic-Device-Join Task and rerun task for Automatic-Device-Join Task after running ”dsregcmd /leave” in an elevated command prompt.
As per Microsoft, this issue will happen device is not registered properly to Azure. This might happen if the,
- Device is not connected to a network or turned off for a while or any device connection issue with Azure.
- Frequent changing of OU of the device on AD
- AD Trust relationship is broken.
- Any device security related issue
- Missing MS office updates
- Credential Issues