Fatal error: UnsafeRawBufferPointer with negative count

I'm using Xcode 14.1 to start a Core Data project. I created a new Project, checking CoreData. The resulting program works in Preview and in the Simulator.

I've changed the data from a Item/timestamp to Locations/title. I plan to add more Attributes but that's for later.

I think I've got all the Item instances changed to Locations and timestamp to title. It seems to work OK when in Preview for ContentView.swift but crashes in the Simulator with the error Swift/UnsafeRawBufferPointer.swift:946: Fatal error: UnsafeRawBufferPointer with negative count Any suggestions on what I have done wrong? Thanks.

PS, the New Project includes the line Text("Select a location") but Select a location doesn't appear in the Preview.