### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

Lambda refs get lost

### Expected Behavior

Lambda refs work in state machines

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

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

    docker run localstack/localstack

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

    awslocal s3 mb s3://mybucket


### Environment

```markdown
- OS: 
- LocalStack:
```


### Anything else?

This is based on a conversation I had with @dominikschubert 
import logging
import os
from typing import TYPE_CHECKING, List
import boto3
import botocore.config
import pytest
from localstack.utils.aws import aws_stack
from localstack.utils.aws.aws_stack import create_dynamodb_table
from localstack.utils.common import is_alpine, short_uid
if TYPE_CHECKING:
    from mypy_boto3_apigateway import APIGatewayClient
    from mypy_boto3_cloudformation import CloudFormationClient
    from mypy_boto3_dynamodb import DynamoDBClient
    from mypy_boto3_iam import IAMClient
    from mypy_boto3_kinesis import KinesisClient
    from mypy_boto3_lambda import LambdaClient
    from mypy_boto3_logs import CloudWatchLogsClient
    from mypy_boto3_s3 import S3Client
    from mypy_boto3_secretsmanager import SecretsManagerClient
    from mypy_boto3_sns import SNSClient
    from mypy_boto3_sqs import SQSClient
    from mypy_boto3_ssm import SSMClient
LOG = logging.getLogger(__name__)
def _client(service):