The WAN facing connection is sometime reinitialised and lost by the OPNsense server.
The solution is to monitor the WAN facing connection.
The script referenced above will try to restore the connetion by bringing the interface down and then up. If that does not work, it will issue a reboot of the system.