Hey, magenta4374036! This is definitely an odd thing to see on three out of four new phones. :/ It's great that you're able to simply open and close the SIM tray, but I agree (especially considering that SIM trays aren't the easiest things to remove/replace) that a permanent solution is in order for your sanity's sake!
Apple has a few troubleshooting steps they offer here: If you get an alert about the SIM card in your iPhone -- have you checked for iOS or Carrier updates already? If those are covered, and since you've already replaced the SIM and have active service, the next step in this situation would be to Contact Us. Just a heads up that if our troubleshooting determines that the issue isn't related to your account or the network, with Apple devices most customers will be connected to Apple directly if an exchange is needed. If you've already completed the troubleshooting based on that Apple support document and want to go ahead and get in touch with the experts on all things iOS from here, you can go to: Contact Apple Support to chat, schedule a call, or make an appointment at an Apple location.