Need a "sleep" between "withSonarQubeEnv" and "waitForQualityGate" or it spins in "IN PROGRESS"

You’re right @NicoB. If the analysis is fast enough to be completed by the time the waitForQualityGate starts, the pipeline will succeed, even with no webhook configured.