Old credentials exported as environment variables
CommonKeys were exported earlier, copied from a console, printed by a script or by aws configure export-credentials. They override every profile and never renew.
Confirm
env | grep -E '^AWS_(ACCESS_KEY_ID|SECRET_ACCESS_KEY|SESSION_TOKEN)=' | sed 's/=.*/=…/' aws configure list
AWS_SESSION_TOKEN set, and aws configure list showing access_key from env
Fix
- Unset them in that shell, so the profile is used again: unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN.
- Use a named profile instead (role_arn plus source_profile, or IAM Identity Center), so the SDK renews credentials itself.
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN
Then aws sts get-caller-identity --profile NAME should work again.