Is your SonarQube Server accessible from your Bitbucket pipeline? Such issues are normally caused by the runner not having access to your SonarQube Server.
This can easily happen if you’re using a Bitbucket-provided runner, but your SonarQube server is on an network resource only accessible internally.