I Googled this error message and found a number of enlightening hits.
Sounds like you are using Apple’s CloudKit or iCloud to sync that the the wanted file not found on their server. Why, dunno. But we do know, from reports here and related to other products, that Apple’s sync services have been unreliable for some. While you weren’t using your Mac, apparently it was turned on, DEVONthink running, and connected to the network. So Apple’s sync engine decided to do a synch. AFAIK, it’s not possible to “schedule” syncs. They just happen automagically if all the conditions in place (sync needed, network available, DEVONthink running, etc.).
I guess best is to simply wait for Apple’s sync to run correctly, or add alternative sync services.
Someone may know more and report here.
Edit: also search for this “NSCocoaErrorDomain 4” message on this site and you’ll find some advice.