Hi,
This was in Message 7.0.x

Changing the Location added info to the "madrid" .plist:-

In both version of Messages 8 the OS passed this info to the .plist
In version 9 is less clear
In Sierra (version 10 for Messages) the location info in not passed across and the "madrid" .plist is not used any more.
Deleting it to try and refresh things does not have it recreated on restarting the app.
As you can see in the second picture the +44 for the UK is in the .plist
It adds (or rather did add) the +44 where needed. (Any Contact's info that does not have a Country Code is presumed to be the one local to you).
Some have suggested that it might default to +1 for the USA but I have not seen this myself.
Ergo Location has everything to do with why this does not work.

8:06 pm Monday; October 23, 2017
iMac 2.5Ghz i5 2011 (Sierra)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
iPhone 6 iOS 11.x and an iPad (2)