The loss of names (or some names) in regards to Messages Conversations can often occur if for some reason iCloud has been turned off (ie. when login out of your Apple ID) or during an upgrade - I’m not certain but both appear to break a link between Contacts and Messages, which may only be temporary or can persist.
I had this on a few occasions happen to the same two contacts, all others remained unaffetched, the solution was to go into Contacts Settings and toggle and/or change the various options under “Short Name”. Also doing similar to the section above for Sort/Display Order might also result in a fix.
The above may need to be done a few times, switching back each time to Messages to see if anything has changed, and Messages App might have to be closed following each viewing - it’s a bit suck and see, what could work for some might be different for others.
Also toggling Nicknames under the same settings and adding said nickname to the problem contact using edit can kick things into working again.