There is no generic watchdog program for this kind of things I’m afraid. The reason why your device cannot be connected by the MM+NM combo could be either a system issue of some sort or, even more likely, a modem firmware issue, or even some network condition problem. If a system reset helps, that would also power cycle the modem I assume, so if it’s a firmware issue at least the modem is not bricked
I’ve lately thought of writing a generic “wwan monitor” program (how I personally call the watchdog) that would work alongside the MM+NM combo to detect stuck mobile connections. NM itself has a retry mechanism to attempt connecting, but again, if the modem firmware is stuck or if the network status of the device isn’t the correct one, only a “hard” solution would be able to help. Sometimes it’s enough to get the modem in airplane mode, because that runs a full IMSI detach procedure with the network, and once the modem is back in full functionality mode the registration with the network is fresh and the connections are allowed again. Some other times, the airplane mode cycle is not enough, and a full modem reset is required (USB reset in the Pi I assume, although other systems have externally controlled power sources via e.g. dedicated GPIOs and such).
I have written multiple “wwan monitor” applications over the last years for multiple clients out there, and each and every application was specific to each client. E.g. some clients required to test not only generic connectivity with the network, but also test explicit TCP/IP connectivity with a given server (think of a data logger that periodically sends data to a specific server). Some other clients wanted to attempt first the airplane mode cycle instead of the full device reset because it’s quicker to reconnect and also safer. Some other clients didn’t care about the likelihood of breaking the module’s internal filesystems and wanted to just go on and fully power off the device externally as soon as it was disconnected to always start fresh. All these different input conditions are client specific and the decisions to take on how to recover are also client specific. Even the actual modem being used affects on what to do! E.g. if a modem that is controlled via AT commands exclusively gets stuck, it may happen that we cannot request a clean reset; while modems controlled with QMI usually never fail to process QMI requests, so it’s easier to always request clean resets. All very client specific, and so the work needed to setup a generic program that fits all needs is too much work, and I’m already very busy just with ModemManager already
For your specific issue, though, a very simple “wwan monitor” program that checks whether the NM connection is up or not, and if it’s up whether it has connectivity to a given remote server would be enough. If the checks fail, you can attempt the USB reset, which may be enough (or not!).