Hey there msetyon,
Thanks for asking the Apple Support Communities about issues with syncing Messages. We're happy to help.
Please start by updating to iOS 16.5.1, as a new iOS can clear up issues in some cases where it's related to the iOS: Update your iPhone or iPad - Apple Support
Also check that your iCloud storage is not over capacity, as that will stop many things from syncing: Manage your iCloud storage - Apple Support
"If you run out of iCloud storage, your device won’t back up to iCloud, new photos and videos won't upload to iCloud Photos, and iCloud Drive, other iCloud apps, and messages won't stay up to date across your devices. And you also won't be able to send or receive emails with your iCloud email address."
Check your iPhone storage too, make sure it's not out of storage to download the messages: How to check the storage on your iPhone and iPad - Apple Support
If you updated and you have plenty of space or making iCloud storage space didn't help, please contact Apple Support to investigate this more: Get Support
Cheers!