### Describe the bug An unhandled exception occurs when closing a window containing a RichEditBox with its SelectionFlyout expanded. ### Steps to reproduce the bug 1. Create a blank WinUI 3 app. 2. Place only one RichEditBox control in the MainWindow. 3. Build and run the app. 4. Type something in the RichEditBox. 5. Select some text to make the flyout appear. 6. Click [...] to expand the flyout. 7. Immediately click the window's close button. ### Expected behavior The app exits without unhandled exceptions. ### Screenshots https://github.com/user-attachments/assets/34cbf9b8-52e3-4f34-9feb-32b64609f6a6 ### NuGet package version WinUI 3 - Windows App SDK 1.7.0: 1.7.250310001 ### Windows version Windows 11 (24H2): Build 26100 ### Additional context _No response_