I had migrated my desktop system to a new iMac about a week ago. Most things worked well, but one frustration was that text messages were not appearing promptly. Messages sent via iMessage appeared simultaneously on the new iMac and my other devices simultaneously, but ordinary SMS text messages were not showing up. I’ve seen this problem before, but I had forgotten the solution.
Anyway, I did find the solution this morning. When I checked the Settings->Messages entry on my iPhone, I saw a ‘Text Message Forwarding’ entry. Tapping it I saw that it was turned on for my iPad and MacBookPro but was off for the iMac. So I flipped it and tested it by logging onto a site that still uses text messages for 2-factor authentication. Sure enough, the message showed up on the iMac. Note that this setting is under the Messages app settings, not the iClooud->Messages setting.