In the last few days I’ve stopped getting SMS text messages on my Mac. It previously worked fine especially the 2FA codes that Safari just adds in. Also, on my iPhone in Settings > Messages there is no longer a setting for Text Message Forwarding - it’s just gone!
I had a similar issue recently (a week or two ago, don’t recall exactly). When I checked the settings on my phone, I noticed that rather than indicating the number of devices for “Text Message Forwarding,” I saw a spinner that ran constantly. Tapping on the option did nothing.
I restarted my phone and that resolved it. It’s possible that signing in and out of my account could have worked as well.