### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

When cloudwatch alarm should trigger alarm action sending message to sns topic the following error messages occurs:

`2023-08-18T08:01:21.489 ERROR --- [   asgi_gw_1] l.aws.handlers.logging     : exception during call chain: could not convert string to float: 'None'
2023-08-18T08:01:21.918 ERROR --- [   asgi_gw_5] l.aws.handlers.logging     : exception during call chain: could not convert string to float: 'None'
2023-08-18T08:01:23.526 ERROR --- [   asgi_gw_0] l.aws.handlers.logging     : exception during call chain: could not convert string to float: 'None'
2023-08-18T08:01:26.861 ERROR --- [   asgi_gw_3] l.aws.handlers.logging     : exception during call chain: could not convert string to float: 'None'
2023-08-18T08:01:32.779 ERROR --- [   asgi_gw_2] l.aws.handlers.logging     : exception during call chain: could not convert string to float: 'None'
2023-08-18T08:01:32.782 ERROR --- [ch-scheduler] l.s.c.alarm_scheduler      : Error executing scheduled alarm
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/utils/scheduler.py", line 64, in run
    self.task(*self.args, **self.kwargs)
  File "/opt/code/localstack/localstack/services/cloudwatch/alarm_scheduler.py", line 294, in calculate_alarm_state
    metric_values = collect_metric_data(alarm_details, client)
  File "/opt/code/localstack/localstack/services/cloudwatch/alarm_scheduler.py", line 243, in collect_metric_data
    metric_data = client.get_metric_data(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/botocore/client.py", line 534, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/botocore/client.py", line 976, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InternalError) when calling the GetMetricData operation (reached max retries: 4): exception while calling cloudwatch.GetMetricData: could not convert string to float: 'None'
`

### Expected Behavior

Alarm should send message to sns topic

### How are you starting LocalStack?

With a `docker run` command

### Steps To Reproduce

### Sequence of actions:
1 - run docker image
2 - run terraform aplly
3 - send message to the queue from localstack container terminal

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

`docker run --rm -eSERVICES=sqs,cloudwatch,sns -p4566:4566 localstack/localstack:2.2.0`

#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

    awslocal sqs send-message \
        --queue-url http://localhost:4566/000000000000/queue-to-watch \
        --message-body '{"test" : "test_message"}'

### Terraform script 

```terraform
terraform {

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.62.0"
    }
  }

  required_version = ">= 1.4.4"
}

provider "aws" {
  region = "us-east-1"

  skip_requesting_account_id = true
  skip_credentials_validation = true
  skip_metadata_api_check     = true
  s3_use_path_style         = true
  access_key                  = "mock_access_key"
  secret_key                  = "mock_secret_key"

  endpoints {
    sqs       = "http://localhost:4566"
    sns       = "http://localhost:4566"
    cloudwatch       = "http://localhost:4566"
  }
}

resource "aws_sns_topic" "error_notifications" {
  name = "error-notifications-topic"
}

resource "aws_sqs_queue" "queue_to_watch" {
  name                 = "queue-to-watch"
}

resource "aws_cloudwatch_metric_alarm" "queue_to_watch_new_message_alarm" {
  alarm_name          = "queue_to_watch_new_message"
  comparison_operator = "GreaterThanThreshold"
  threshold           = 0
  evaluation_periods  = 1
  metric_name         = "NumberOfMessagesSent"
  namespace           = "AWS/SQS"
  dimensions = {
    QueueName = aws_sqs_queue.queue_to_watch.name
  }
  period              = 1 * 60 // 1 minutes
  statistic           = "SampleCount"

  alarm_description   = "New event in queue-to-watch queue"
  alarm_actions       = [aws_sns_topic.error_notifications.arn]
}
```

### Environment

```markdown
- OS: macOS 13.4.1 (22F770820d)
- LocalStack: 2.1.0 and 2.2.0
```


### Anything else?

[cloudwatch_alarm_error.log](https://github.com/localstack/localstack/files/12377169/cloudwatch_alarm_error.log)

"""
    Checks if a premature alarm should be triggered.
    https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#CloudWatch-alarms-avoiding-premature-transition:
    [...] alarms are designed to always go into ALARM state when the oldest available breaching datapoint during the Evaluation
    Periods number of data points is at least as old as the value of Datapoints to Alarm, and all other more recent data
    points are breaching or missing. In this case, the alarm goes into ALARM state even if the total number of datapoints
    available is lower than M (Datapoints to Alarm).
    This alarm logic applies to M out of N alarms as well.
    """
    treat_missing_data = alarm_details.get("TreatMissingData", "missing")
    if treat_missing_data not in ("missing", "ignore"):
        return False
    datapoints_to_alarm = alarm_details.get("DatapointsToAlarm", 1)
    if datapoints_to_alarm > 1:
        comparison_operator = alarm_details["ComparisonOperator"]
        threshold = alarm_details["Threshold"]
        oldest_datapoints = metric_values[:-datapoints_to_alarm]
        if oldest_datapoints.count(None) == len(oldest_datapoints):
            if metric_values[-datapoints_to_alarm] and COMPARISON_OPS.get(comparison_operator)(
                metric_values[-datapoints_to_alarm], threshold
            ):
                values = list(filter(None, metric_values[len(oldest_datapoints) :]))
                if all(
                    COMPARISON_OPS.get(comparison_operator)(value, threshold) for value in values
                ):
                    return True
    return False
def collect_metric_data(alarm_details: MetricAlarm, client: "CloudWatchClient") -> List[float]: