Hi @shreyas.p,
You should be able to catch the error and get the JSON response-body. You can try wrapping the request in a try/catch and display the error response by calling the getResponseBody() method.
Example:
try{
$new_customer = $customersApi->create([
//request_body
]);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getResponseBody(), "\n";
}