### Is there an existing issue for this?

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

### Question

Problem when following chalice tutorial with chalice-local and localstack:
https://aws.github.io/chalice/quickstart.html

```
DEBUG=1 localstack start

chalice-local new-project hello
cd hello/
chalice-local deploy

/home/raul/git_repos/provider-manager/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
Creating deployment package.
Creating IAM role: hello-dev
Creating lambda function: hello-dev
Creating Rest API
Resources deployed:
  - Lambda ARN: arn:aws:lambda:us-east-1:000000000000:function:hello-dev
  - Rest API URL: https://4yr9k2ce77.execute-api.us-east-1.amazonaws.com/api/


(venv) raul:~/.../provider-manager/hello (master) $ http http://localhost:4566/restapis/4yr9k2ce77/api/_user_request_/
HTTP/1.1 500 
Access-Control-Allow-Headers: authorization,cache-control,content-length,content-md5,content-type,etag,location,x-amz-acl,x-amz-content-sha256,x-amz-date,x-amz-request-id,x-amz-security-token,x-amz-tagging,x-amz-target,x-amz-user-agent,x-amz-version-id,x-amzn-requestid,x-localstack-target,amz-sdk-invocation-id,amz-sdk-request
Access-Control-Allow-Methods: HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: etag,x-amz-version-id
Connection: close
Content-Length: 462
Content-Type: text/html; charset=utf-8
date: Fri, 06 May 2022 15:47:55 GMT
server: hypercorn-h11

{
    "errorMessage": "'stageVariables'",
    "errorType": "KeyError",
    "stackTrace": [
        "  File \"/var/task/chalice/app.py\", line 1238, in __call__\n    self.current_request = handler.create_request_object(event, context)\n",
        "  File \"/var/task/chalice/app.py\", line 1660, in create_request_object\n    self.current_request = Request(event, context)\n",
        "  File \"/var/task/chalice/app.py\", line 406, in __init__\n    self.stage_vars = event_dict['stageVariables']\n"
    ]
}

```



```
(venv) raul:~/.../provider-manager/hello (master) $ chalice --version
chalice 1.27.0, python 3.9.12, linux 5.15.0-27-generic
(venv) raul:~/.../provider-manager/hello (master) $ localstack --version
0.14.2.8
(venv) raul:~/.../provider-manager/hello (master) $ 
```



### Anything else?

_No response_
env_vars_before = lambda_executors.LambdaExecutorLocal.set_default_env_variables()
            try:
                handler_module = load_source(lambda_id, lambda_file)
                module_vars = handler_module.__dict__
            finally:
                lambda_executors.LambdaExecutorLocal.reset_default_env_variables(env_vars_before)
                
                
                
                
                post_sys_modules_keys = set(sys.modules.keys())
                for key in post_sys_modules_keys:
                    if key not in pre_sys_modules_keys:
                        sys.modules.pop(key)
        except Exception as e:
            LOG.error("Unable to exec: %s %s", script, traceback.format_exc())
            raise e
        finally:
            if lambda_cwd or lambda_env:
                if lambda_cwd:
                    os.chdir(previous_cwd)
                    sys.path.pop(0)
                if lambda_env:
                    os.environ = previous_env
        return module_vars[handler_function]
    lock = EXEC_MUTEX if lambda_cwd or lambda_env else empty_context_manager()
    with lock:
        return _do_exec_lambda_code()
def get_handler_function_from_name(handler_name, runtime=None):