I have an Android Moto G with the same problem. I have been googling around trying to figure out what the problems is and how to fix it, search terms: Loose Sim Card, I came across this thread, in addition to many others. I am normally a Mac Boy and have an account here, so I thought I would try to post a helpful message. (In spite of Apple loyalty, I couldn't afford the Apple Tax for the iPhone.)
Apparently, almost every brand of phone has had this problem with SIM cards since around 2008. The iPhone 3G had very similar problems. Judging by the torrent of threads all over the internet, and the legions of frustrated users, it appears to be generic to most or all smart phones that use SIM cards. Maybe there's a fundamental problem with the technical specifications for SIM cards or SIM card trays. Maybe the manufacturers find it too difficult to maintain necessary manufacturing tolerances and quality control.
FWIW, in my case, it appears that the SIM card gets a tiny bit loose in its tray, though it hasn't ejected. If I gently push it back into its tray, about a millimeter, it starts working again, though I might have to restart my phone, and sometimes have to enter the SIM lock key, also known as the PUK. Fortunately, I know my SIM key. A lot of users don't.
I've already exchanged the phone for a new one. This problem seems well-known for Moto G, so I thought the manufacturer would have improved the hardware by now. No way. The new phone has the same problem as the old one. Many phone owners who exchange their phone with a new one are reporting no improvement with this problem.
Few users, of any brand, are reporting that replacing the SIM card is helpful.
Having read dozens of threads, the most reliable fix seems to involve physically jamming the SIM card in the tray, so it can't work itself loose. Apparently, routine use of the phone causes bumps and jolts that cause the SIM card to get slightly displaced in the tray.
Some people just shove two or three small pieces of thin, durable paper between the SIM card and the tray, taking care not to cover the gold contacts on the SIM card. Others report good results with removing the SIM card, placing one, two or three layers of scotch tape on the card, and replacing it.
The advantage of tape is it will probably stay in one place after you press it down. One worries that the adhesive might bleed out from underneath the tape, damage the card or the tray. However, I haven't found any reports of that. Some users worry that doing so might void the warranty. On the other hand, the warranty covers the phone, not the SIM card, and SIM cards can be removed from phones.
Hope this is helpful. Hope this message doesn't get killed because I don't own an iPhone. Just trying to help. I feel your pain.