User with a domain contributor role used the domain id associated with the application for automatically uploading the scan result.
A user needs to pass the domain ID where the user is attached to and not the domain Id where the application is attached to.
The best method to find the correct Domain ID is to use the CLI assistant available at APPLICATION SCANS and then selecting the application to be scanned. The CLI assistant will generate the CLI command with correct domain ID. This is the domain ID where the currently logged in user is attached to and not the domain Id where the application is attached to.