

In that case, something in is invalidating the login. Are you sure that it is happening due to leaving your LAN, and not just coinciding with that?
Does restarting the laptop log you out, or temporarily disconnecting from the internet? Could you test by switching to a wifi hotspot on your phone, and switching back, for example?
The client stores your session token in the OS credentials manager (kwallet for linux kde, for example) and the issue can lie there, as well.



Then my first assumption is that the session token is not being correctly stored in kwallet. It can’t restore the session after kwallet is closed.
You can open kwallet manager, and delete the wallet. This will prompt your system to re-create it next time you go to use something that needs it (wifi, nextcloud).
This will allow you to essentially reset the default wallet.
The typical settings for it are “blowfish” encryption with either a blank password (which encrypts nothing, but allows the wallet to always open reliably) or using the same password as your user (which allows the wallet to decrypt automatically upon login).
Another user also commented with useful links, the arch wiki page on kwallet is also potentially useful.