Hi there,
I've been chasing this issue for a while now. It affects both LAN & WLAN connections happens randomly so it can be hard to repeat to get the initial cause. I'm running an RPI4 Model B - 4GB. It will run perfectly for a while before I have an issue where it will remain connected to the local network with no internet access. This is shown by the 'state' within the wired or wireless settings showing 'ready' instead of 'online'. Another dead giveaway from boot is the time is incorrect.
The only way of getting the internet side of things to work again is restoring the pi the factory settings or doing a clean install. In trying to tinker with the network settings to get things working again I noticed when moving the 'Connect Automatically' within the network settings, it will slide off and on and upon saving the settings, exiting and entering them again it keeps sliding back to off. It's like the network settings side of things are completely broken.
I've also tried 'Wait for network before starting Kodi' which doesn't help either. Attached is the log. You'll see in there a VPN is being used and I thought initially this was the problem but after uninstalling this completely, the issue still persists. Any help would be hugely appreciated.