could you share your device's model number and software version? also, are you using the stock samsung messages app?
Could you share a little more detail on how or when it started to happen? is it after an update or randomly after you muted your device for a while?
For less effort requiring option of solution, you could report an error to the Samsung Members app after reproducing the issue (not hearing any notification sound after receiving a txt/msg)... it would also be helpful to take a screen recording with the system sound included.
Or you could take it to UBreakIFix repair center, but I think they deal more towards hardware related stuff... not sure how deep into the software repairs they handle.