For anyone else facing a similar issue. The issue will arise if you are running using a profile configured in another user. The config file should be in same user's ~/.aws directory.
If you have switched to another user when running the command it will try to find the profile of that user