AWS documents that credentials generated by aws configure are stored in the standard path ~/.aws/credentials:
The AWS CLI stores the credentials that you specify with aws configure in a local file named credentials, in a folder named .aws in your home directory.
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
This path is not utilized by credentials stored by aws configure sso or aws sso login.
Other tools (like Terraform and Boto3) that rely on this standard do not function because they do not see the credentials stored in the ~/.aws/cli/cache/ JSON files.
Shared credential file (~/.aws/credentials)
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html