I had the same issue and Apple support couldn't provide a solution for over 1 week, for an iPhone SE with standard SIM card.
Then I came across this community discussion by searching for "AppleID imessage SIM block".
Specifically, my issue was that on the [Settings > #YourName# "Apple ID, iCloud, ..." > "Login and Security"] I could see my AppleID and my phone number, but below the phone number the message "This phone number cannot be used in iMessage and FaceTime...you need a SIM card associated with an Apple device" appeared.
Reading through and following approximately the notes of user manishr15, I did the following and the issue was solved for me:
• Turn off iMessage from [Settings > Messages > iMessage]
• Turn off FaceTime from [Settings > FaceTime]
• Turn off wifi and turn on the mobile network (4G or 5G)
• Remove SIM and re-insert SIM. Check that the 4G or 5G mobile network works normally again.
I then did these 3 extra steps just in case, which I thought could be useful - but perhaps not necessary:
•• Went to [Settings > #YourName# "Apple ID, iCloud, ..." > "Login and Security"] and removed my phone number, then added the same phone number again at the same place. (Note: Make sure that you can still receive the security code via SMS or through another trusted device.)
•• Shutdown the iPhone and turn it back on.
•• Checked again that the 4G or 5G mobile network works normally.
So, at this point resumed the notes of user manishr15
• Go to [Settings > Messages] and turn on iMessages.
• Then below on "Send and Receive", I pressed on my AppleID as was shown, and then selected "Use Other AppleID".
This last selection -which seemed rather unreasonable and is not mentioned elsewhere- then restored normal connection to iMessage, OK!
Hope this helps.