### 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_
lambda_function: LambdaFunction,
        env_vars: Dict,
        lambda_cwd: str,
        docker_flags: str = None,
    ):
        docker_image = Util.docker_image_for_lambda(lambda_function)
        container_config = LambdaContainerConfiguration(image_name=docker_image)
        container_config.name = self.get_container_name(lambda_function.arn())
        
        env_vars.pop("AWS_LAMBDA_EVENT_BODY", None)
        container_config.env_vars = env_vars
        container_config.network = get_container_network_for_lambda()
        container_config.additional_flags = docker_flags
        container_config.dns = config.LAMBDA_DOCKER_DNS
        if lambda_cwd:
            if config.LAMBDA_REMOTE_DOCKER:
                container_config.required_files.append((f"{lambda_cwd}/.", DOCKER_TASK_FOLDER))
            else:
                lambda_cwd_on_host = Util.get_host_path_for_path_in_docker(lambda_cwd)
                
                if ":" in lambda_cwd and "\\" in lambda_cwd:
                    lambda_cwd_on_host = Util.format_windows_path(lambda_cwd_on_host)
                container_config.required_files.append((lambda_cwd_on_host, DOCKER_TASK_FOLDER))
        container_config.entrypoint = "/bin/bash"
        container_config.interactive = True
        if config.LAMBDA_STAY_OPEN_MODE:
            container_config.env_vars["DOCKER_LAMBDA_STAY_OPEN"] = "1"
            
            container_config.env_vars.pop("DOCKER_LAMBDA_USE_STDIN", None)
            container_config.entrypoint = None