Nextcloud creating duplicate folders inside itself, recursively, for any sync after upgrading to v4.0.0 Windows Desktop Client

This is not the expected behavior. Could you provide screenshots of the issue? Before attaching information about the issue, please run

files:scan --all

on your server to update the database links. It is recommended that no one interact with the system during this operation.