Maybe your error is caused by the way you're invoking the REST API or maybe the projectKey is not correct (you need to use the project's key and not its name).
It's not clear exactly how you submited the report file but you can use a bash script to submit your results as follows.
In this example, you will need to have an auxiliary file with your api key credentials, having something like:
{ "client_id": "215FFD69FE460000000000","client_secret": "2c00f8f22f56a8684d7518cd6147ce278700000000000000000000" }
Then you can execute the following script (copy it to a file named submit.sh, for example).
PROJECT=TM
TESTPLAN=
BROWSER=
token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" https://xray.cloud.xpand-it.com/api/v2/authenticate| tr -d '"')
curl -H "Content-Type: application/xml" -X POST -H "Authorization: Bearer $token" --data @"target/surefire-reports/testng-results.xml" "https://xray.cloud.xpand-it.com/api/v2/import/execution/testng?projectKey=$PROJECT&testPlanKey=$TESTPLAN&testEnvironments=$BROWSER"