### 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_
"Handler": lambda_function.handler,
        "Runtime": lambda_function.runtime,
        "Timeout": lambda_function.timeout,
        "Description": lambda_function.description,
        "MemorySize": lambda_function.memory_size,
        "LastModified": format_timestamp(lambda_function.last_modified),
        "TracingConfig": lambda_function.tracing_config or {"Mode": "PassThrough"},
        "RevisionId": func_version.get("RevisionId"),
        "State": "Active",
        "LastUpdateStatus": "Successful",
        "PackageType": lambda_function.package_type,
        "ImageConfig": getattr(lambda_function, "image_config", None),
        "Architectures": lambda_function.architectures,
    }
    if lambda_function.dead_letter_config:
        result["DeadLetterConfig"] = lambda_function.dead_letter_config
    if lambda_function.envvars:
        result["Environment"] = {"Variables": lambda_function.envvars}
    arn_parts = result["FunctionArn"].split(":")
    if (always_add_version or version != VERSION_LATEST) and len(arn_parts) <= 7:
        result["FunctionArn"] += ":%s" % version
    return result
def forward_to_fallback_url(func_arn, data):
    """If LAMBDA_FALLBACK_URL is configured, forward the invocation of this non-existing
    Lambda to the configured URL."""
    if not config.LAMBDA_FALLBACK_URL:
        return
    lambda_name = aws_stack.lambda_function_name(func_arn)
    if config.LAMBDA_FALLBACK_URL.startswith("dynamodb://"):
        table_name = urlparse(config.LAMBDA_FALLBACK_URL.replace("dynamodb://", "http://")).netloc