Error using SwiftData and WindowGroup

Hi folks, i've been getting a weird not helpful error when trying to use SwiftData and WindowGroup, here's the error:

Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs)

And here's my app file:

struct DocumentApp: App {
    private var container = try! ModelContainer(for: Document.self)
    
    var body: some Scene {  
        WindowGroup(id: "main") {
            InfoWindow()
        }
        .modelContainer(container)
        .windowResizability(.contentSize)
        
        WindowGroup(id: "note", for: Document.Note.ID.self) { $detailID in
            @Query var documents: [Document]
            
            let openDoc = documents.first { $0.id == "\($detailID)" }
            NoteView(note: openDoc?.notes)
        }
        .defaultSize(CGSize(width: 550, height: 550))
        .windowResizability(.contentSize)
        
        ImmersiveSpace(id: "board") {
            ProjectBoard()
                .modelContainer(container)
        }
        .immersionStyle(selection: .constant(.mixed), in: .mixed)
    }
    
    
}

Thanks to anyone who took the time to read this post!

Hi, I experimented a little and thought why not taking { $0.id == detailID } directly instead of wrapping it in a string { $0.id == "($detailID)" } because I managed to find this error from your code: "Referencing operator function '==' on 'StringProtocol' requires that 'UUID' conform to 'StringProtocol'". (instead of the unhelpful "Failed to produce.." error). However, I am not 100 percent sure this will fix, but I hope you can try it. Have a great day!

Hi thanks, doesn't matter what i do it always returns the "requires to conform to StringProtocol" error and i'm running out of ideas on how to fix this

Error using SwiftData and WindowGroup
 
 
Q