Someone mentioned they had this problem due to an issue with their APN settings. Not sure what in the settings would cause it to sometimes work and sometimes not, but it’s worth a shot. Easiest option is to check your SIM provider’s website for instructions on how to set the correct APN settings.