### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

A lambda from my step function can return an error (if a condition is not satisfied) but in a local environment the return error does not fall in my custom catch, falling only in States.ALL.

```json
"Catch": [
        {
          "ErrorEquals": [
            "TooManyRequestsException"
          ],
          "Next": "Wait and Try Later"
        },
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "Next": "Catch All"
        }
      ]
    },
    "Wait and Try Later": {
      "Type": "Wait",
      "Seconds": 10,
      "Next": "Catch lambda"
    },
    "Catch All": {
      "Type": "Fail",
      "Cause": "Unknown error!",
      "Error": "Caiu no erro geral"
    }
```


I'm generating the error customizing like this

```javascript
module.exports.handler = async function context(
  event,
  context,
  options
) {

  class CustomError extends Error {
    constructor(message){
      super(message);
      this.name = "TooManyRequestsException"
    }
  }
  const err = new CustomError('new error')
  throw err;
}
```

### Expected Behavior


I did the same procedure in the aws console and it worked perfectly falling into the custom error, only in the development environment that I couldn't and I came for help.

Does anyone know if it can be some configuration?

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

```yaml
version: '3.8'

services:
  localstack:
    image: localstack/localstack
    environment:
      - DEBUG=true
      - SERVICES=lambda,stepfunctions,iam,apigateway,s3,ses
      - DATA_DIR=/tmp/localstack/data
      - TZ=America/Fortaleza
      - LAMBDA_DOCKER_NETWORK=payment-api
      - LAMBDA_EXECUTOR=docker
    ports:
      - 4566:4566
    volumes:
      - /tmp/localstack:/tmp/localstack
      - /var/run/docker.sock:/var/run/docker.sock
      - .:/server
    depends_on:
      - mongo
```

### Environment

_No response_

### Anything else?

_No response_
func_name = lambda_function.name()
        url = "%s%s/functions/%s/invocations" % (forward_url, API_PATH_ROOT, func_name)
        copied_env_vars = lambda_function.envvars.copy()
        copied_env_vars["LOCALSTACK_HOSTNAME"] = config.HOSTNAME_EXTERNAL
        copied_env_vars["LOCALSTACK_EDGE_PORT"] = str(config.EDGE_PORT)
        headers = aws_stack.mock_aws_request_headers("lambda")
        headers["X-Amz-Region"] = lambda_function.region()
        headers["X-Amz-Request-Id"] = context.aws_request_id
        headers["X-Amz-Handler"] = lambda_function.handler
        headers["X-Amz-Function-ARN"] = context.invoked_function_arn
        headers["X-Amz-Function-Name"] = context.function_name
        headers["X-Amz-Function-Version"] = context.function_version
        headers["X-Amz-Role"] = lambda_function.role
        headers["X-Amz-Runtime"] = lambda_function.runtime
        headers["X-Amz-Timeout"] = str(lambda_function.timeout)
        headers["X-Amz-Memory-Size"] = str(context.memory_limit_in_mb)
        headers["X-Amz-Log-Group-Name"] = context.log_group_name
        headers["X-Amz-Log-Stream-Name"] = context.log_stream_name
        headers["X-Amz-Env-Vars"] = json.dumps(copied_env_vars)
        headers["X-Amz-Last-Modified"] = str(int(lambda_function.last_modified.timestamp() * 1000))
        headers["X-Amz-Invocation-Type"] = invocation_type
        headers["X-Amz-Log-Type"] = "Tail"
        if context.client_context:
            headers["X-Amz-Client-Context"] = context.client_context
        if context.cognito_identity:
            headers["X-Amz-Cognito-Identity"] = context.cognito_identity
        data = run_safe(lambda: to_str(event)) or event
        data = json.dumps(json_safe(data)) if isinstance(data, dict) else str(data)
        LOG.debug(
            "Forwarding Lambda invocation to LAMBDA_FORWARD_URL: %s", config.LAMBDA_FORWARD_URL