I had a similar disaster when I upgraded to Sonoma from Ventura. A popup asked if I wanted to use iCloud with Documents and Desktop folders. Foolishly, I agreed, thinking that this would back up my Documents and Desktop and keep them safe in iCloud without reorganizing my Mac.
Boy was I wrong. A few hours later, I noticed I no longer had anything on my Desktop (except the Mac hard drive icon) and my Document folder was empty. I can't function without these and am sometimes offline.
I called support. One of many calls over several days. I was told to turn off documents and desktop in iCloud in Mac settings. This initiated a 63 GB download from iCloud to my Mac. Part way through, it hung and never completed. I later found my Desktop folders in an archive folder, but most of my docs were missing form the Documents archive folder. Poof, no warning.
When the download hung, I called Apple Support again and got the usual runaround that seems to be the norm when there's a real problem. I looked for a way out on my own and found that I could not transfer files directly from iCloud to my Mac by dragging and dropping, but I could drag and drop iCloud folders to a large USB stick. So, I copied iCloud Documents and Desktop to the memory stick, and this saved me.
I checked the files and folders, and everything seemed to be on the memory stick. I then tried to get the transferred data back to the Mac directly from iCloud. Somewhere during these efforts most of my documents vanished. No warning, just poof, 14 GB of essential data gone. I logged into iCloud online and was unable to restore the missing document folders; I was instructed to try later. Later didn't work either.
I discovered that subfolders could not be moved from the iCloud to my Mac. A small window would open announcing that iCloud was "preparing" to move the data, but nothing was ever moved, even after 20 minutes with a folder that only contained a few small files. Maybe after an hour something useful would have happened, but I don't have that much patience.
I found I could drag and drop individual files to my Mac, but never folders, they always hung "preparing". Whoops.
To restore my Mac from the memory stick, I turned off the Documents and Desktop in iCloud settings on the Mac, then deleted all the files in the Documents and Desktop folders on iCloud. Then I restored my Documents and Desktop on the Mac from the memory stick. Phew. Everything seemed to be back, so I deleted the duplicate Desktop archive folder from my hard drive and also the partial Documents archive folder that apparently resulted from an incomplete download from iCloud.
Apple Support was no help. Some tried but when they saw (via screenshare) what was going on they all fired blanks. Even worse, some bailed - several times the phone just went dead, and I did not receive a feedback request.
Several days after the stalled download from iCloud, I had a major internet outage that lasted most of the day. It's possible that there were some issues a few days before that played a role in the fiasco, but it is well known that Internet access is not 100% reliable so maintaining data integrity under such circumstances is a hard design requirement. Whoops.
Regardless of root causes, it's unimaginable that Apple would actually remove all my Desktop and Document files from my computer, without warning. Without these files, my computer became useless without a fast Internet connection and that's not always there. If I had lost all my files, it would have been life changing.
When my Internet went down a few days later, I needed information from the moved data just to contact my ISP and give them the account number before I could even get support. I needed my home network configuration data to log into my router and the Internet gateway to review status. Fortunately, I had all this information on the memory stick, or I'd still be looking for a way out. My ISP resolved the problem on the day I contacted them, I restored the computer from the USB stick and reorganized my desktop, all good now.
Disappointed in the Sonoma upgrade, iCloud behavior and how Apple support fumbled the ball. I bought a 2 TB Toshiba USB C drive and backed up my Mac. I have lots of memory on iCloud but won't be using it for backups after this.