Apple recommends adding some launch arguments and environment variables to your Xcode schemes to catch and debug Core Data problems.

https://useyourloaf.com/blog/debugging-core-data/