System.NullReferenceException: Object reference not set to an instance of an object

We have a task in our azure PR pipeline to run sonar cloud analysis and the task is falling with the following exception.
20:59:36.848 Creating directory: D:\a\1.sonarqube\conf
20:59:36.848 Creating directory: D:\a\1.sonarqube\out
20:59:36.89 Downloading from https://sonarcloud.io/api/server/version
##[error]20:59:47.622 Failed to request and parse ‘https://sonarcloud.io/api/server/version’: Object reference not set to an instance of an object.
##[debug]Processed: ##vso[task.logissue type=error;]20:59:47.622 Failed to request and parse ‘https://sonarcloud.io/api/server/version’: Object reference not set to an instance of an object.
20:59:47.622 Failed to request and parse ‘https://sonarcloud.io/api/server/version’: Object reference not set to an instance of an object.
##[debug]Processed: ##vso[task.logissue type=error;]

##[error]Unhandled Exception:
##[debug]Processed: ##vso[task.logissue type=error;]Unhandled Exception:
##[error]System.NullReferenceException: Object reference not set to an instance of an object.
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass18_0.<b__0>d.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.d__17`1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.d__11.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.d__9.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.d__8.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.d__4.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.d__3.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.(String args)
##[debug]Exit code 3762504530 received from tool ‘D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.19.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’
##[debug]STDIO streams have closed for tool ‘D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.19.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’
##[debug]task result: Failed
##[error]The process ‘D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.19.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 3762504530
##[debug]Processed: ##vso[task.issue type=error;]The process ‘D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.19.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 3762504530
##[debug]Processed: ##vso[task.complete result=Failed;]The process ‘D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.19.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 3762504530
Finishing: Prepare analysis on SonarCloud