Text message notifications sometimes fail intermittently when iPhone is in sleep mode
For a long time my text messages have arrived, sometimes with an accompanying sound and on-screen notification on my iPhone, sometimes without. It's been maddeningly unpredictable.
I've kept an eye on the forums over a period of months, and the obvious solutions are offered and have been ineffective for myself and many other users. These include making sure the volume is up, the phone isn't in vibrate mode, Do Not Disturb is off, bedtime hours are off, resetting the phone to factory defaults, etc. etc.
I hope it's not bad form to answer your own question, but I found the culprit in my situation. I'll share it as an answer, below. Hopefully it will be helpful to others! Hint: it involves using your Mac when the message arrives.