Xcode downloads client crash reports for NSApp.runModalForWindow(_:)

Xcode contains several crash reports downloaded from users of my app. Thread 0 apparently crashes after calling NSApp.runModalForWindow(_:) (within the redacted stacktrace rows 17-19 that are locations in my own code). All the other threads only contain calls to system code.

What could cause such a crash?

...
Code Type:             ARM-64
Parent Process:        launchd [1]
User ID:               501
...
OS Version:            macOS 13.5.2 (22G91)
...
Crashed Thread:        0

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x000000018800c728

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [61015]

Thread 0 Crashed:
0   AppKit                        	0x000000018800c728 -[NSApplication _crashOnException:] + 240 (NSApplication.m:6808)
1   AppKit                        	0x0000000187e54a10 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 644 (NSCATransaction.m:98)
2   AppKit                        	0x0000000188530cfc ___NSRunLoopObserverCreateWithHandler_block_invoke + 64 (AppKit_Internal.h:745)
3   CoreFoundation                	0x0000000184b059f0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1789)
4   CoreFoundation                	0x0000000184b058dc __CFRunLoopDoObservers + 532 (CFRunLoop.c:1902)
5   CoreFoundation                	0x0000000184b04f14 __CFRunLoopRun + 776 (CFRunLoop.c:2944)
6   CoreFoundation                	0x0000000184b044b8 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   HIToolbox                     	0x000000018e356df0 RunCurrentEventLoopInMode + 292 (EventLoop.c:455)
8   HIToolbox                     	0x000000018e356a80 ReceiveNextEventCommon + 220 (EventBlocking.c:311)
9   HIToolbox                     	0x000000018e356984 _BlockUntilNextEventMatchingListInModeWithFilter + 76 (EventBlocking.c:171)
10  AppKit                        	0x0000000187d2b97c _DPSNextEvent + 636 (CGDPSReplacement.m:818)
11  AppKit                        	0x0000000187d2ab18 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716 (appEventRouting.m:407)
12  AppKit                        	0x0000000187f63bd0 -[NSApplication _doModalLoop:peek:] + 216 (NSApplication.m:3469)
13  AppKit                        	0x0000000187f62ad4 __35-[NSApplication runModalForWindow:]_block_invoke_2 + 56 (NSApplication.m:3516)
14  AppKit                        	0x0000000187f62a80 __35-[NSApplication runModalForWindow:]_block_invoke + 108 (NSApplication.m:3516)
15  AppKit                        	0x0000000187f62364 _NSTryRunModal + 100 (NSModal.m:25)
16  AppKit                        	0x0000000187f62224 -[NSApplication runModalForWindow:] + 292 (NSApplication.m:3516)
...
20  AppKit                        	0x0000000187ed34cc -[NSApplication(NSResponder) sendAction:to:from:] + 440 (appEventRouting.m:1888)
21  AppKit                        	0x0000000187ed32e4 -[NSControl sendAction:to:] + 72 (NSControl.m:1459)
22  AppKit                        	0x0000000187fda170 -[NSTableView _sendAction:to:row:column:] + 116 (NSTableView.m:9022)
23  AppKit                        	0x0000000187fd8d70 -[NSTableView mouseDown:] + 4224 (NSTableView.m:11191)
24  AppKit                        	0x0000000187ecdef0 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 3476 (winEventRouting.m:1003)
25  AppKit                        	0x0000000187e58b2c -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 364 (winEventRouting.m:402)
26  AppKit                        	0x0000000187e587ec -[NSWindow(NSEventRouting) sendEvent:] + 284 (winEventRouting.m:257)
27  AppKit                        	0x0000000187e57b30 -[NSApplication(NSEvent) sendEvent:] + 1556 (appEventRouting.m:0)
28  AppKit                        	0x00000001880a7c48 -[NSApplication _handleEvent:] + 60 (NSApplication.m:3342)
29  AppKit                        	0x0000000187d1efa0 -[NSApplication run] + 500 (NSApplication.m:3430)
30  AppKit                        	0x0000000187cf63cc NSApplicationMain + 880 (NSApplication.m:9413)
31  MyApp                           0x0000000102980cd0 main + 128 (main.swift:12)
32  dyld                          	0x00000001846cff28 start + 2236 (dyldMain.cpp:1165)
...
Xcode downloads client crash reports for NSApp.runModalForWindow(_:)
 
 
Q