Indeed - if it tries to connect to a wifi network that isn’t there, it goes back in a minute or so to the original one.
But if it connects to a wifi network that is there, but just doesn’t have working internet access, would it stay connected to that network as long as it could, not doing anything useful?