You’re not missing anything; this is the way analysis works. The process of analysis is succeeding.
… Okay, maybe you are missing something here. What happens when you run mvn sonar:sonar is that an analysis report is generated and submitted to the server for asynchronous processing. Once the report is successfully submitted to the server, the local process ends. At this point, the QG status has not yet been calculated. It is only once the report is popped off the queue and processed server-side that the QG status is (maybe) updated. When you’re running analysis in a CI/CD context, there are ways to make it pause until the SonarQube sends a webhook notification that processing is complete, and the status of the CI/CD job can be updated based on the QG. But you’re not going to get that functionality in a local, Maven build.
As a developer, I want to be able to replicate the CI build on my local box, so that I can know that my code changes will not break the build before I commit them.