As per the article https://support.apple.com/en-in/guide/mac-help/mchlp1145/mac
Another Mac user on your local network can share files with you by putting them in their Public folder. You can also share your files with another local Mac user by putting them in their Drop Box (a folder inside the Public folder).
Also in the article - If you don’t see a Public folder on the other Mac, make sure it has file sharing turned on. See Set up file sharing on Mac.
And when you open system preferences > Apple ID icon > iCloud > in front of iCloud Drive > option and uncheck the box of desktops and documents a pop up appears .

You can see errors if read and write permissions of that folder are changed to no access https://support.apple.com/en-in/guide/mac-help/mchlp1122/10.15/mac/10.15
https://support.apple.com/en-in/guide/mac-help/mchlp1203/10.15/mac/10.15
Better check the box of desktops and documents .
If you uncheck the box of desktops and documents .
It will prompt the items from this desktop and the documents folder are available in iCloud Drive , to remove items from iCloud Drive , move them to your desktop and documents folder on this Mac , click on show in finder .
Again open system preferences > iCloud > iCloud Drive > the box of desktops and documents box is unchecked , tap over the box to get it rechecked , a circle rotates setting up the box gets checked .
You will notice a folder is created literally on the desktop , tap it a pop up window appears the items on this desktop on this Mac have been moved into a new folder called “ Desktops - Apples Mac book …( the name of Mac will be written in the existing desktop folder in iCloud Drive , you can combine the contents of these folders any time , click on show in finder .
As you might have created a file and then dragged and dropped in that folder , after that moved in drop box , the folder read and write permissions are to be checked have you give any restrictions to permissions .