This happened to me. iPhone and iCloud were syncing just fine, BUT the MacBook Pro's contacts (10.13.5) would not sync, plus I couldn't even type new contacts in on the computer, (turned into a no name), nor edit old contacts on the computer.
I'm just a lay person here, and I was walked through a fix with a local tech guy. I don't remember the entire order of things, so I'd suggest calling Apple AND backing up first!!! (Also, I exported all my Vcards to a thumb drive so I'd have them to import back in if all went wrong!) But, it was something like, (as long as you confirm syncing is working in the cloud but for that computer)- turn off contacts in iCloud. Go to library (a hidden file, it's option something or other) and then Application Support/AddressBook and take those files (all of them, even though on line there's a few people who say just take 3... that didn't work)- and put in a temp folder on desktop (so you can move them back if need be.) I know it's scary, and empty folder, but then I think we turned the sync back on and voila. There might have been other steps in there... but that's the gist. It worked! It repopulated the address book and when I went back to look in library, it repopulated those files. I'd spent hours and hours with Apple techs and no one knew how to do that.
But if you ask about it, maybe they will know THIS.
Good luck everyone!