Hello, I used your sample project as my starting point for iOS 14's Sidebar, so first : thanks. :)
I have the same problem: I launch the app in compact mode (XS Max or your steps on iPad simulator), then I rotate the phone to go primary/secondary and it crashes.
HOWEVER, I just tried launching the app from the Home screen, without Xcode, and it works as it should be. I think it's more of a debugger/Xcode issue.