When you are using @ModelActor you have access to a specific model context for that actor via the property modelContext so you should have
try modelContext.delete(…
and you should definitely not use the context from the main actor in any other actor.
This alone will probably not fix the crash since you have a reference to the deleted objects in self._rooms that you need to clear before doing the delete.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: