It seems that you have accidentally enabled the Desktop & Documents folders option in iCloud Drive, and it syncs your Mac desktop and documents folders with iCloud. You can disable this feature by heading to the Apple menu > System Settings > tap your name, then select iCloud > iCloud Drive, toggle off Desktop & Documents folders.
When you turn it off, your desktop and documents folders won't go back to their original location, it automatically creates a Desktop and Documents folder containing your data in the Mac home folder called iCloud Drive (Archive). You can manually copy these files back to your Desktop and Documents folders.
Read more:
How to Move Files/Documents from iCloud to Mac (Quick Ways)