Run the failing command with the exact named profile you intend to use and note the profile name.

Run an SSO login for that same profile and complete the browser sign-in.

Retry the original command immediately with the same profile.

If the error returns later, compare the SSO start URL and region in the profile with the values used at login; a renamed session or a changed start URL uses a different cache entry.

Check whether a cleanup tool, a roaming profile reset, or a container rebuild deletes the AWS cache folder between sessions.