### 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_
self.destroy_docker_container(func_arn)
                
                LOG.debug("Creating container: %s", container_name)
                self.create_container(lambda_function, env_vars, lambda_cwd, docker_flags)
                LOG.debug("Starting docker-reuse Lambda container: %s", container_name)
                DOCKER_CLIENT.start_container(container_name)
                def wait_up():
                    cont_status = DOCKER_CLIENT.get_container_status(container_name)
                    assert cont_status == DockerContainerStatus.UP
                    if not in_docker():
                        return
                    
                    lambda_docker_ip = DOCKER_CLIENT.get_container_ip(container_name)
                    if self._should_use_stay_open_mode(lambda_function, lambda_docker_ip):
                        full_url = self._get_lambda_stay_open_url(lambda_docker_ip)
                        wait_for_port_open(full_url, sleep_time=0.5, retries=8)
                
                retry(wait_up, retries=15, sleep=0.8)
            container_network = self.get_docker_container_network(func_arn)
            entry_point = DOCKER_CLIENT.get_image_entrypoint(docker_image)
            LOG.debug(
                'Using entrypoint "%s" for container "%s" on network "%s".',
                entry_point,
                container_name,
                container_network,
            )
            return ContainerInfo(container_name, entry_point)
    def create_container(
        self,