iOS text tone doesn't sound
It appears that if you have Messages in iCloud enabled on the iPhone, and you're also signed in to Messages on a Mac with the same Apple ID, and the Mac is logged in and awake, then the iPhone doesn't make an alert sound for new messages. Presumably the idea is that you're at the Mac and will see the message alert there.

I don't know of a way to configure this other than switching off Messages in iCloud on the phone.