I think I have made some progress with this by introducing manual saves when working on the model, so for example, instead of:
selectedItem = item
I have replaced with:
do {
try modelContext.transaction {
selectedItem = item
} catch {
print("unable to save change due to error \(error)")
}
Items are now successfully persisting, and the error:
SwiftData/ModelContext.swift:3253: Fatal error: Failed to identify a store that can hold instances of SwiftData.
Seems to have gone away.
It seems like the error was something to do with the way that changes are stashed and saved in the background by SwiftData, I am not an expert but my best guess is that it is related to the recent changes in concurrency architecture.
I have also found SwiftData to be much more reliable if you work directly on elements derived from @Query in the view, rather than trying to save on @Bindable from a parent. I pass the UUID around the views and then filter the arrray from @Query for the id.