Hi Tushmesh, welcome to the SonarSource Community!
The tasks are not designed to fail the build just because there’s an issue found in the code being analyzed. The Publish step would add the quality gate status to your pipeline execution but otherwise it succeeds.