I am trying to set up Sonar Gerrit - Jenkins Plugin on a Jenkins job.
Context
I suspect there's a issue with your REST API connection between Jenkins and Gerrit.
The "Sonar Gerrit" plugin uses the "Gerrit Trigger" plugin to post messages in Gerrit. The "Gerrit Trigger" plugin can use two different methods to post messages in Gerrit: SSH or REST API.
The "Build Failed ... FAILURE" message is posted directly by "Gerrit Trigger" plugin and it can be performed using SSH. The "Sonar Gerrit" messages CAN'T be performed using SSH, they need to be done using REST API so the "Gerrit Trigger" plugin needs to be configured to use REST API to enable "Sonar Gerrit" plugin to post in Gerrit.
See more info here.
Go to Jenkins > Manage Jenkins > Gerrit Trigger > Edit > Advanced
And check if the REST API is enabled and if it's working as expected (using the "Test REST Connection" button)