According to the AWS documentation, the AWS Parameters and Secrets Lambda Extension cannot be used outside of the handler function.
The extension can be invoked only in the
INVOKEphase of the the Lambda and not during theINITphase.
While top-level await occurs during INIT phase
Reference: https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html