Do you have the latest version of Windows 10? If you have version 1909 then this issue should be fixed, according to conversations in User Voice. https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/12980892-machine-rename-azure-ad
This was reported with earlier versions but should have been resolved.
If you're seeing this issue with the latest version then I will check in with the product team to see the status of this issue.