Hello buna2301,
Thank you for posting in the Apple Support Communities. We're sorry to see that you're experiencing this issue with iMessage on your Mac, and we'd like to provide you with support.
First, open the Contacts app on both devices and make sure that the phone number for you and your contacts are using the appropriate country prefix formatting for the region.
Next, were your contacts synced from a third-party email account (i.e. Gmail, Exchange, Yahoo, AOL, etc.)? If so, we suggest logging in to the web version of the account to see if those contacts appear correctly there.
From there, try creating a new iMessage thread with your contact to see if this issue returns. You can also delete, then add back the contact in the Contacts app. Here’s how:
Use Messages with your Mac
If this concern isn't resolved, contact Apple Support for further assistance:
Get Support
We hope this information is useful. Kind regards.