This reset worked for me as well (iPhone XS) - I was intermittently not receiving alerts for both iMessages and text messages for several months. The message would be there when I looked at my lock screen but never made a sound or vibration to alert me. What siamless typed (Settings>General>Reset>Reset All Settings) is the only fix that seemed to solve the problem (has worked for last 2 months).
This is what "Reset All Settings" does:
-Resets all of your device's settings like Wallpaper, Sounds, Display & Brightness, Background App Refresh, Date & Time, and more.
-Resets Wi-Fi credentials in all iCloud Keychain devices that use the Apple ID if iCloud Keychain is turned on.
-Removes all of your previously used Wi-Fi networks and passwords
-Removes your Apple Pay cards.
-Deregisters your device from iMessage and FaceTime
-Removes your Touch ID & Passcode
-If restrictions are turned on, it resets all of your restrictions.
-Removes Face ID
-Resets accessibility settings
-It removes your encrypted backup password