Set provider.profile via stage parameters

I’m getting the following error when I try to set provider.profile via stage parameters:

Error:
Cannot resolve serverless.yml: "provider.profile" property is not accessible (configured behind variables which cannot be resolved at this stage)

Here is what my serverless.yml looks like:

provider:
  stage: ${opt:stage, 'dev'}
  profile: ${param:AWS_PROFILE}
params:
  dev:
    AWS_PROFILE: devProfile

Perhaps it’s just not possible to set provider.profile this way. Can anyone tell me if I’m just missing something? My other stage params are working just fine. Thank you.