I have an iPhone 12. In my case, Messages stopped playing notification sounds with the installation of iOS 18 (which I didn't do until 18.3). Mail stopped playing notification sounds with the installation of 18.4. I'm currently on 18.4.2. My wife has an iPhone 13 with iOS 18.4.1 and she gets notification sounds on messages (she has it turned off on mail).
I've tried every fix given on every related thread I can find here - including hard resets and uninstall/reinstall of mail. Nothing works.
This is really pretty simple in my mind. If everything worked on the phone, and it stops working with the installation of a new version of iOS, THE PROBLEM IS WITH IOS. It appears to work differently depending on the model of phone. Why?
Apple has a history of bringing out "cool new features" and breaking the old ones when they do it. For example, my email account has not worked right on MacOS since El Capitan. I've spent hours with Apple support and nobody's ever been able to figure it out.
This may get fixed, or it may never get fixed. Nothing we can do about it.