fix(API): Fix usage of `getXhrErrorResponseHandler` (#49119)
This fixes two places where we've been using `getXhrErrorResponseHandler` wrong, either passing it a JSON object rather than an error message (leading to `Error: [object Object]` events in Sentry) or failing the call the handler it returns.