I had this issue on my iPhone 12 Pro Max since I got it last Friday and it was driving me nuts. I even tried the two public betas of iOS 14.3 to see if they fixed the issue (nope).
However, prompted by some comments on this forum, I changed some settings on my other phone on the same account and lo and behold, on now get notifications for iMessages on my new device.
Some detail: I have a work iPhone (an 8) which I have logged in to the same account as my personal phone (to access media, etc). Subsequently I can choose to receive messages to either number on either device. I had my personal phone set to only receive messages sent to my personal number/email and my work phone set to receive both work messages and personal ones. After removing the personal number from the work phone, my personal phone (the 12) suddenly started getting notifications/sounds for messages sent while locked (whereas previously it only worked if unlocked). It’s possible this might work with other devices on the same account (iPad etc) if set to receive on the same number as your iPhone 12. Not ideal, but worked for me.