I had that guess too, however, myEntity.isDeleted is false when this occurs.
Also, I am fetching the model right before deleting it. Here I have just noticed something weird in the documentation, namely that model(for:) creates an unsaved instance if called with an unknown ID. So I tried the same with registeredModel(for:), but I get the same error
https://developer.apple.com/documentation/swiftdata/modelcontext/model(for:)
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: