Hi,
I have the same problem ever since upgrading from OS X Yosemite.
After troubleshooting this issue with Apple Support and iCloud engineering for several months, I discovered the underlying issue with Apple ID and the macOS Messages app. This is not a fix, just an explanation with no practical work around. It is up to Apple to ultimately address this issue. Nevertheless I hope the information will be useful to others troubleshooting the same problem.
As several people have mentioned in this thread, the macOS Messages app region setting was removed in OS X El Capitan and macOS Sierra, however the iMessage region preference flag continues working on the same Mac even after upgrading from Yosemite to El Capitan and Sierra as long as the user never signs out of iCloud, iMessages or FaceTime.
However If the user signs out of these services after upgrading from Yosemite, the iMessages region defaults to the country setting of the Apple ID/iTunes account credit card and cannot be overridden on the local Mac. This causes the iMessages Contact name problem if you live in a different country than your Apple ID/iTunes account country setting.
For example I live in Japan most of the time but my Apple ID/iTunes account is set to the USA with a USA issued credit card attached to the account. In this case the macOS Messages app cannot format or send to local Japanese iMessage enabled iPhone numbers and will not match or group numbers with contacts. Everything works fine on iOS Messages side for the same Apple ID because the iMessages region setting can be set to Japan.
The only option for macOS iMessage users not residing in the same country as their Apple ID/iTunes account credit card & country setting is to change the iTunes account credit card and country setting matched with a locally issued credit card. The iTunes account credit card validation process seems to be what actually sets the Apple ID account country. Switching the country however invalidates all iTunes content purchased with the previous country issued credit card.
The easiest thing would be for Apple to restore the region setting to the macOS Messages app, similar to what has always existed in the macOS FaceTime app.