### 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_
LambdaEvent = Union[Dict[str, Any], str, bytes]
HOOKS_ON_LAMBDA_DOCKER_SEPARATE_EXECUTION = "localstack.hooks.on_docker_separate_execution"
HOOKS_ON_LAMBDA_DOCKER_REUSE_CONTAINER_CREATION = (
    "localstack.hooks.on_docker_reuse_container_creation"
)
on_docker_separate_execution = hook_spec(HOOKS_ON_LAMBDA_DOCKER_SEPARATE_EXECUTION)
on_docker_reuse_container_creation = hook_spec(HOOKS_ON_LAMBDA_DOCKER_REUSE_CONTAINER_CREATION)
class InvocationException(Exception):
    def __init__(self, message, log_output=None, result=None):
        super(InvocationException, self).__init__(message)
        self.log_output = log_output
        self.result = result
class LambdaContext(object):
    DEFAULT_MEMORY_LIMIT = 1536
    def __init__(
        self, lambda_function: LambdaFunction, qualifier: str = None, context: Dict[str, Any] = None
    ):
        context = context or {}
        self.function_name = lambda_function.name()
        self.function_version = lambda_function.get_qualifier_version(qualifier)
        self.client_context = context.get("client_context")
        self.invoked_function_arn = lambda_function.arn()
        if qualifier:
            self.invoked_function_arn += ":" + qualifier
        self.cognito_identity = context.get("identity")
        self.aws_request_id = str(uuid.uuid4())
        self.memory_limit_in_mb = lambda_function.memory_size or self.DEFAULT_MEMORY_LIMIT
        self.log_group_name = "/aws/lambda/%s" % self.function_name
        self.log_stream_name = "%s/[1]%s" % (timestamp(format="%Y/%m/%d"), short_uid())
    def get_remaining_time_in_millis(self):