### Is there an existing issue for this?

- [X] I have searched the existing issues and read the documentation

### Question

Hey!
This is the first time I've used LocalStack, so maybe I'm doing something wrong, but I'm getting a 500 error when trying to invoke my lambda through API GW for no apparent reason. So, repro steps:
1. Super-simple Node lambda returning 200 and "ok" body.
2. API GW integration pointing to the lambda.
3. Everything is deployed via Terraform without issues.

However, a POST request to the lambda's endpoint results in:

```
{"errorType": "InvocationException", "errorMessage": "Object of type datetime is not JSON serializable", "stackTrace":
[" File \"/opt/code/localstack/localstack/services/awslambda/lambda_api.py\", line 739, in run_lambda\n
callback=callback,\n", " File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 224, in
execute\n return do_execute()\n", " File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\",
line 214, in do_execute\n return _run(func_arn=func_arn)\n", " File
\"/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py\", line 157, in wrapped\n raise e\n", " File
\"/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py\", line 153, in wrapped\n result = func(*args,
**kwargs)\n", " File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 201, in _run\n
raise e\n", " File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 189, in _run\n
result = self._execute(func_arn, func_details, event, context, version)\n", " File
\"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 1022, in _execute\n raise
InvocationException(result, log_output)\n"]}
```

Any ideas?

### Repro steps
main.tf
```
terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "~> 3.49.0"
    }
  }
}

####################### DATA SOURCES #######################
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}

####################### LOCALS #######################
locals {
  common_tags = {
    project = "samcum"
  }
}

####################### VARIABLES #######################
variable "webhook_lambda_filename" {
  type = string
  default = "../../samcum-webhook-lambda/samcum-webhook-lambda.zip"
}

####################### RESOURCES #######################
resource "aws_iam_role" "samcum_webhook_lambda_iam" {
  name = "iam_for_lambda"

  assume_role_policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
EOF

  tags = local.common_tags
}

resource "aws_lambda_permission" "samcum_webhook_lambda_execute_permission" {
  statement_id  = "AllowExecutionFromAPIGateway"
  action        = "lambda:InvokeFunction"
  function_name = aws_lambda_function.samcum_webhook_lambda.function_name
  principal     = "apigateway.amazonaws.com"

  source_arn = "arn:aws:execute-api:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:${aws_api_gateway_rest_api.samcum_rest_api.id}/*/${aws_api_gateway_method.samcum_samsara_event_method.http_method}${aws_api_gateway_resource.samcum_samsara_event_resource.path}"
}

resource "aws_lambda_function" "samcum_webhook_lambda" {
  filename = var.webhook_lambda_filename
  function_name = "samcum_webhook_lambda"
  role = aws_iam_role.samcum_webhook_lambda_iam.arn
  handler = "dist/main/lambdaHandler.lambdaHandler"
  source_code_hash = filebase64sha256(var.webhook_lambda_filename)
  runtime = "nodejs14.x"

  tags = local.common_tags
}

resource "aws_api_gateway_rest_api" "samcum_rest_api" {
  name = "samcum-api"

  tags = local.common_tags
}

resource "aws_api_gateway_resource" "samcum_samsara_event_resource" {
  path_part   = "samsara-event"
  parent_id   = aws_api_gateway_rest_api.samcum_rest_api.root_resource_id
  rest_api_id = aws_api_gateway_rest_api.samcum_rest_api.id

}

resource "aws_api_gateway_method" "samcum_samsara_event_method" {
  rest_api_id   = aws_api_gateway_rest_api.samcum_rest_api.id
  resource_id   = aws_api_gateway_resource.samcum_samsara_event_resource.id
  http_method   = "POST"
  authorization = "NONE"

}

resource "aws_api_gateway_integration" "samcum_api_webhook_lambda_integration" {
  rest_api_id             = aws_api_gateway_rest_api.samcum_rest_api.id
  resource_id             = aws_api_gateway_resource.samcum_samsara_event_resource.id
  http_method             = aws_api_gateway_method.samcum_samsara_event_method.http_method
  integration_http_method = "POST"
  type                    = "AWS_PROXY"
  uri                     = aws_lambda_function.samcum_webhook_lambda.invoke_arn

}

resource "aws_api_gateway_deployment" "samcum_rest_api_deployment" {
  rest_api_id = aws_api_gateway_rest_api.samcum_rest_api.id
  triggers = {
    redeployment = sha1(jsonencode([
    aws_api_gateway_resource.samcum_samsara_event_resource.id,
    aws_api_gateway_method.samcum_samsara_event_method.id,
    aws_api_gateway_integration.samcum_api_webhook_lambda_integration.id,
  ]))
  }

  lifecycle {
    create_before_destroy = true
  }
}

resource "aws_api_gateway_stage" "samcum_rest_api_stage" {
  deployment_id = aws_api_gateway_deployment.samcum_rest_api_deployment.id
  rest_api_id   = aws_api_gateway_rest_api.samcum_rest_api.id
  stage_name    = "prod"
}

####################### OUTPUTS #######################
output "samcum_rest_api_id" {
  value = aws_api_gateway_rest_api.samcum_rest_api.id
}

output "samcum_rest_api_deployment_stage" {
  value = aws_api_gateway_stage.samcum_rest_api_stage.stage_name
}
```

lambdaHandler.ts
```
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";

export const lambdaHandler = async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {
    console.log("All good!");
    return {
        statusCode: 200,
        body: JSON.stringify({message: "Hello from lambda!"})
    };
};
```

`curl --location --request GET 'http://localhost:4566/restapis/pgcmkm1bv2/prod/_user_request_/samsara-event'`
_No response_
def _execute(
        self, func_arn, func_details, event, context=None, version=None
    ) -> InvocationResult:
        lambda_cwd = func_details.cwd
        environment = self._prepare_environment(func_details)
        
        queue = Queue()
        lambda_function = func_details.function(version)
        def do_execute():
            
            result = None
            try:
                if lambda_cwd:
                    os.chdir(lambda_cwd)
                    sys.path.insert(0, "")
                if environment:
                    os.environ.update(environment)
                result = lambda_function(event, context)
            except Exception as e:
                result = str(e)
                sys.stderr.write("%s %s" % (e, traceback.format_exc()))
                raise
            finally:
                queue.put(result)
        process = Process(target=do_execute)
        start_time = now(millis=True)
        error = None
        with CaptureOutput() as c:
            try:
                process.run()