Thanks for asking the Apple Support Communities for help with your message Notifications. I am happy to look at this with you.
Go to Settings > Notifications > Messages. Turn Notifications off. Then, restart your iPhone: Restart your iPhone, iPad, or iPod touch
When it comes back up, go back to Settings > Notifications > Messages and re-enable Notifications. Please ensure the settings here are correct since you are re-enabling it now.
If you still have issues, is your device paired with bluetooth headphones or an Apple Watch? If so, please unpair the headphone and test. If it is an Apple Watch, please check this help article: Notifications on your Apple Watch - Apple Support
Where you’ll see your notifications
We'll send notifications to the device that you're using, so you can see them as soon as possible.
If your iPhone is unlocked, you'll get notifications on your iPhone, instead of your Apple Watch.
If your iPhone is locked or asleep, you'll get notifications on your Apple Watch, unless your Apple Watch is locked with your passcode.
When you dismiss notifications on your Apple Watch, they’re also dismissed from your iPhone. You receive notifications on whichever device you’re using, not both devices at the same time.
Thanks and have a wonderful day.