Interestingly, having sync'd my contacts with my NextCloud, I have found a couple of contacts whose number does not want to work with Messages.
All my contact numbers have international prefixes, eg. +61 x xxxx xxxx.
It appears that if I go into Contacts, edit the phone number, delete the leading +, which causes the number to compact down to consecutive digits, and re-insert the +, which causes the phone number to resume it's nicely formatted appearance, IMHO, all of a sudden, the phone number is now 'fixed' and works with Messages.
Not the ideal fix, but I do get told by Messages that the contact phone number won't work, up front, it's just a pain to have to edit the contact to 'fix' it.