@DTS Engineer Albert, thanks for the response.
Error
Please see the screenshot of the fault log,
Subsystem for the log iscom.apple.cloudkit
Category for the log is Scheduler
Answer to your questions:
Cloud sync works and data gets synced, no issue with the data.
Yes correct primary sync doesn't happen via BGTaskScheduler.
However SwiftData / CloudKit initiates a background task to do some processing.
The background is the one that gets blocked.
This is a clean new project (no 3rd party libraries) and I have written the code so I am sure of that there is no background task I am initiating.
Testing / Sample project:
If you really want to test it, please refer to the project attached in FB22634797
Though FB22634797 is for a different issue, the Xcode project would throw the fault log in Xcode.
It is a very simple project.
Question
It would be great if someone from SwiftData / CoreData / CloudKit team can confirm this.