I'm facing a the same problem.
In my case I'm collecting data in background mode. If internet connection gets lost, large amount of data might be sync when the device gets back on the internet. If data collection is still active, the background mode seems to keep NSPersistentCloudKitContainer alive resulting in the iCloud sync not being terminated and the app getting killed due to high CPU pressure.
What framework are you using? I'm using SwiftUI. I'm also still looking for a solution.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: