Thanks for the clear report and example project. I independently reproduced this on macOS and confirmed it was a Studio integration bug, not a problem with your code.
ShowAtItem waits for the contextual menu to close. The native macOS menu bar was not light-dismissing that menu, so commands such as Quit remained queued until the contextual menu was dismissed manually.
This is now fixed in the next release. Using the macOS menu bar first dismisses the open contextual menu, allows ShowAt or ShowAtItem to return normally, and then runs the selected main-menu command.
The fix is scheduled for the next release: macOS main-menu commands wait for open contextual menus.