### 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_
import base64
import glob
import json
import logging
import os
import re
import subprocess
import sys
import threading
import time
import traceback
from multiprocessing import Process, Queue
from typing import Tuple
from localstack import config
from localstack.services.awslambda.lambda_utils import (
    LAMBDA_RUNTIME_JAVA8,
    LAMBDA_RUNTIME_JAVA11,
    LAMBDA_RUNTIME_PROVIDED,
)
from localstack.services.install import INSTALL_PATH_LOCALSTACK_FAT_JAR
from localstack.utils import bootstrap
from localstack.utils.aws import aws_stack
from localstack.utils.aws.dead_letter_queue import (
    lambda_error_to_dead_letter_queue,
    sqs_error_to_dead_letter_queue,
)