Hello @SR VSP ,
Root Element Missing when connecting to SharePoint online via CSOM/Powershell on windows 10 machine
This is a known issue specific to the particular machine where you are executing this code. In order to fix this issue, need to change the DNS setting in your machine.
Please follow steps:
1.Control Panel >> Network and Internet >> Network and Sharing Center >> Change adapter settings >> select the Network through which you are connecting to Internet

2.Right click on it and select Properties >> select Internet Protocol Version 4 (TCP/IPV4) and click Properties

3.Select "Use the following DNS Server Addresses" option and give the DNS whatever you want.
- Google public DNS addresses : 8.8.8.8 and 8.8.8.4

4.Click OK button to apply these changes.
Thanks,
Echo Du
=====================
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.