It sounds like it's not the wifi since you're getting the sim error.
I got sim not valid errors (or something like that) after I'd been in Asia for 2 weeks where it was humid. I thought it was a phone or SIM card problem, but as soon as I hit Japan on a layover it took a long time before the error came up. Then zero problems when I made it back to the states. Must have been the very dry atmosphere in the plane.
If moisture doesn't seem to be an issue, then maybe the SIM needs replacing. You could try cleaning the contacts.
For the heck of it, try this VOIP test which will check the wifi connection to see if it's capable of handling calls. But since the wifi is going in and out it does seem to be on the phone side. MySpeed VoIP connection test, VoIP test, test VoIP performance, test VoIP quality