You should have an Apigee policy that handles errors returned by the target server.
If you don't configure error handling using a policy, the API proxy goes into an
error state in the <TargetEndpoint>
response, and the normal
API proxy flow won't continue to the <ProxyEndpoint>
.