0 byte files in iCloud

I’m trying to find a solution to an iCloud sync issue I have. I’ve been fighting this with Apple Engineers since last November with no resolution. There last solution was I should flatten the Mac and rebuild it. And yep I’ve just done that and the issue is still there. The files in iCloud all seem to sync okay but the iCloud status shows as:

I can ‘fix’ the sync by signing out of the Mac and signing back in (reinitialising iCloud) but the problem comes back in a short time (varies between 24 hours to 4 days).

I’m now wondering if zero byte files could be part of the issue. So I’m wondering if I can run a script on the iCloud folder to identify 0 byte (or other files of a size I designate).

Any help appreciated. I’m looking to avoid wiping the iCloud and recreating it.

This is not fast. And not flexible. Finds only 0K files.

with timeout of (30 * 60) seconds
	set ss to "find ~/Library/Mobile\\ Documents -empty -type f"
	set emptyFileList to do shell script ss
end timeout

Instant results, but returns less files than I get running the ‘find’ code above. 384 vs 1551.

set ss to "mdfind kMDItemFSSize = '0' -onlyin ~/Library/Mobile\\ Documents/"
set emptyFileList to do shell script ss

Many thanks, both are appreciated.