Obviously if the saved reference becomes invalid, there's nothing AutoTrash could do to fix it. But the reference shouldn't become invalid in the first place. It's strange.
On the plus side, the new messaging and UX you added makes the problem easier to deal with. Saves a click not having to first unset the invalid saved network. :)
And I've tried the same map in single-player, with AutoTrash 4.1.10 (the new version). This issue also happens there, so it doesn't seem related to multiplayer at all.
I spent some time doing this:
- Disable one mod
- Restart Factorio
- Load game
- Move so the "invalid network" alert triggers
- Set main network again in AutoTrash
- Move to confirm it un-pauses
- Save & quit map
- Load map
- Move to see if "invalid network" alert triggers
It was a tedious cycle, and after doing it with about a dozen mods I decided to just disable everything except AutoTrash. Performing the same "trigger, fix, save, load, trigger" sequence surprised me when the same issue happened without any other mods loaded. I'm not sure what's going on any more.