### 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_
context_json_string = "%s" % (json.dumps(context.__dict__) if context else "{}")
        cmd = [
            "node",
            "-e",
            f'const res = require("{main_file}").{function}({event_json_string},{context_json_string}); '
            f"const log = (rs) => console.log(JSON.stringify(rs)); "
            "res && res.then ? res.then(r => log(r)) : log(res)",
        ]
        LOG.info(cmd)
        result = self._execute_in_custom_runtime(cmd, lambda_function=lambda_function)
        return result
    def execute_go_lambda(self, event, context, main_file, lambda_function: LambdaFunction = None):
        if lambda_function:
            lambda_function.envvars["AWS_LAMBDA_FUNCTION_HANDLER"] = main_file
            lambda_function.envvars["AWS_LAMBDA_EVENT_BODY"] = json.dumps(json_safe(event))
        else:
            LOG.warning("Unable to get function details for local execution of Golang Lambda")
        cmd = GO_LAMBDA_RUNTIME
        LOG.debug("Running Golang Lambda with runtime: %s", cmd)
        result = self._execute_in_custom_runtime(cmd, lambda_function=lambda_function)
        return result
    @staticmethod
    def set_default_env_variables():
        
        default_env_vars = {"AWS_DEFAULT_REGION": aws_stack.get_region()}
        env_vars_before = {var: os.environ.get(var) for var in default_env_vars}
        os.environ.update({k: v for k, v in default_env_vars.items() if not env_vars_before.get(k)})
        return env_vars_before
    @staticmethod
    def reset_default_env_variables(env_vars_before):