I'd say that it was because your PC clock was wrong due to the failing battery.
As a result of an incorrect time, the time tagged parts of the network access failed. By delaying the boot, allowing the router up first, you were subsequently allowing the NTP service to set your PC clock and so it would work. Rebooting from then on would continue to work as the clock would be correct - surviving the reboot. Switching it off for a long period, again caused a reset and so failure.
The open network problem I'm guessing is a bit of a red herring in that your PC tried connecting to your encrypted network, failed and so reverted to trying to connect to a public open network in the vicinity.