I'm experiencing the same issue after upgrading to Safari 17.5 and macOS 12.7.5. Here's the crashing thread's backtrace:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x182c23564 object_getClass + 48
1 Foundation 0x183d1cd9c _NSKeyValueObservationInfoGetObservances + 276
2 Foundation 0x183e9bf24 NSKeyValueWillChangeWithPerThreadPendingNotifications + 240
3 AppKit 0x1859ee964 -[NSView _viewDidChangeAppearance:] + 220
4 AppKit 0x1859ed50c -[NSView _setSuperview:] + 1520
5 AppKit 0x185a1489c -[NSView removeFromSuperview] + 148
6 AppKit 0x185a8d1ac -[NSView removeFromSuperviewWithoutNeedingDisplay] + 52
7 AppKit 0x185a1a83c -[NSView _finalize] + 956
8 AppKit 0x185a1a348 -[NSView dealloc] + 136
9 AppKit 0x185a98214 -[NSVisualEffectView dealloc] + 260
10 AppKit 0x185d0a900 -[NSPopoverFrame dealloc] + 88
11 libobjc.A.dylib 0x182c24d44 AutoreleasePoolPage::releaseUntil(objc_object**) + 196
12 libobjc.A.dylib 0x182c216a4 objc_autoreleasePoolPop + 212
13 AppKit 0x1859cafcc -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3804
14 Safari 0x107195178 -[BrowserApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 236
15 AppKit 0x1859bc7ec -[NSApplication run] + 596
16 AppKit 0x18598df08 NSApplicationMain + 1132
17 Safari 0x107586130 SafariMain + 524
18 dyld 0x104cdd08c start + 520