I tried to solve the issue by uninstalling OneDrive, removing all OneDrive Application and Data folders from the computer using the following script.
:: Removing remaining OneDrive folders.
rd "%UserProfile%\OneDrive" /s /q
rd "%LocalAppData%\Microsoft\OneDrive" /s /q
rd "%LocalAppData%\OneDrive" /s /q
rd "%ProgramData%\Microsoft OneDrive" /s /q
rd "%systemdrive%\OneDriveTemp" /s /q
:: Removing remaining OneDrive registry keys.
REG DELETE "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG DELETE "HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG DELETE "HKCR\Software\SyncEngines\Providers\OneDrive" /f
Did a reinstall of latest OneDrive version with /allusers parameter.
After configuration and syncing OneDrive I started adding also SharePoint folders that I was syncing. Initially it looked ok, but after a number of folders the issue is back again. Will continue to zoom in on what SharePoint location is causing the issue. Maybe removing them one by one is enough to solve the issue and track down the root cause...