CoreData & CloudKit - unexpected behavior and suddenly stop of syncing

I know, there are tons of post dealing this topic, but after days of searching for errors, solutions ans answers I'm done.

In the beginning, everything worked fine. Then, my App crashed suddenly because of a silly error in code. Never mind, I fixed this error, but since then, no syncing is done anymore.

Not enough, I recognized a field called "entityName" on Development AND Productivity which mustn't be there.

Simply deleting app and reinstall won't make anything different. Logging out and in again (neither mac nor appleID) won't give a solution.

I can't delete my app from my mac with all it's related data (e.g. with AppCleaner) and reinstall it, because data isn't synced yet. So all my data will be deleted, too and I will lose my data.

I need help. Why is there a field, that must NOT be there? Why did iCloud stop syncing? How can I solve this, without losing my data? Is there a "flag" in database, that controls syncing, so I can change it, using an SQL-Browser? Is there a hidden file, I can delete, to start syncing again? How can I get rid of this strange field, or is it a part of cloudkit and belongs to it?

Please excuse this vague information, but it's a) already difficult to describe the problem exactly and b) my English is pretty bad.

To describe it a little more: I have a macBook Air (M2) as my main computer. My app is running here and it (should) sync the data to iCloud (both cloudkit and iCloud files). Then there is a Mac mini (M2) that runs the same program in the same version under the same Apple ID. My employee should be able to view the data and change it if necessary. This worked fine for a few days, but then the syncing stopped.

From Apple's dashboard (https://icloud.developer.apple.com/) I can see that the data is definitely not arriving in the cloud anymore. (login as me)

I just found something else: Changes made on the Mac mini (employee) will be synced to CloudKit. In any case, data arrives in the CloudKit. Also changes directly made in CloudKit will arrive at my app on Mac mini. So syncing itself and my app are working. So there might be a problem on the MacBook Air, where syncing is stopped or delayed.

IMO it has to do with local database. Editing directly in CloudKit, changes are synced to Mac Mini but not to MacBook. Editing on mini will change CloudKit, but not MacBook

When completely deleting my app on MacBook und reinstalling, syncing starts and works fine. Restoring a backup just of database-Files (.sqlite), syncing stopps again. Is inside the database a flag, that prevents syncing? Structure of database should be the same.

Nobody any idea? I know the information is scarce, but if I knew more I would be much closer to the solution. What I know so far: Mac A: Master Mac B: S.er.va.nt

Data on Mac A isn't synced to CloudKit while data from CloudKit is synced to Mac B and the other way round. When I completely delete the app on Mac A (including database file called ***.sqlite), syncing starts again on Mac A, but all Data I added meantime on Mac A is gone. Restoring only database file (***.sqlite) on Mac A, syncing stopps again on Mac A.

So in my opinion, there must be a flag inside the sqlite-file or there's a special character in database I accidentally used, so syncing won't start.

It would be very nice, if somebody can help. And if I had one wish, dear fairy, it would be very nice if maybe a developer from Apple could comment on it. I know: nice try, but one can wish.

CoreData & CloudKit - unexpected behavior and suddenly stop of syncing
 
 
Q