Getting "fatal: No such remote 'composer'" while installing this command
I am getting this error while installing this. Am I doing something wrong?

Looks like you used the git URL vs the package name when installing?
How about this:
wp package install wp-cli/profile-command to install latest stable.
@leonstafford
Actually I was trying different things. I followed as shown here https://github.com/wp-cli/profile-command#installing But getting the same error.
@buntybuddyboss sorry, I didn't read it properly. I've tried all variations to install and were fine, also on mac OS (11.4, M1).
Could you please share your ~/.wp-cli/packages/composer.json - maybe has some clues as to the missing remote.
I noticed my git ref used in the installation looked different than yours. Maybe can also delete the Composer cache and the vendor dir that's being used and try again with the wp package install https://github.com/wp-cli/profile-command.git