Connection is lost when restarting router

I suspect that this is not the reason.

More than likely, the problem is related to time. In order for VPNs to function, the time must be correct. It is likely that the clock on the local device is not sync'd with NTP after the restart at the time that WG starts. The result is that WG cannot connect and there is no route to the NTP servers via the regular wan. It becomes a chicken or egg.

The solution is to hold WG back until NTP has sync'd. This is discussed in a bunch of threads... here's one: