If we have several keys with the same comment, for example:
ssh-rsa <base64> my_user_name ssh-ed25519 <base64> my_user_name
They are applied one by one by Cloud-init. And since the comment is used as a key name in the CLI config, each next key replaces the previous one.
To fix this, we need to check if a key with the same comment already exists and generate a new unique key name for such cases.