Citing this excellent blog article if some files are generated during the build and referenced (directly or not) by the compilation database, we will need them during analysis. This means that even if you configure analysis with a compilation database, enough of the build should be run that the generated files are present for analysis (or are retrieved from some cache),
Even when a compilation database is being used (and not the build wrapper), the analysis must still take place in the same environment as the build. It is not possible, for example, to check into source control a compilation database generated on a developer’s local machine and expect that analysis will be successful in a CI environment.
The expectation is that some build will have taken place that generates the compilation database which is immediately used for analysis (whether’s it’s a full, clean build, or an incremental build).
Then it seems like there’s some connectivity issue between your build server and your SonarQube instance. I would suggest adding a simple curl to your pipeline to see if you receive the same error code. As your SonarQube server is being served over HTTPS, this is likely being returned by the proxy sitting in front of your SonarQube server.