When you click on their Avatar and select message, that user should already be set as the message recipient so you shouldn’t have to add that particular user.
If you Copy and Paste another user name, it will have a popup of the valid user name(s). If you don’t select from the list of valid user names (either clicking on it or hitting enter), it will consider it an invalid name. There are technical reasons for it, but if you just paste the name without selecting the valid name from the list it won’t link it to the user. That is true even if you pasted a perfectly valid name.
If you are selecting a name from the popup and it still says that the name is invalid then I’m not sure what the issue is. I’d have to experiment to see if I can produce the same result to be able to say why it fails and how to work around it.