How is the alert presented in the second UIWindow? Is it the root view controller, or is presented on the root view controller?
Not sure if this works but did you try implementing the AppDelegate method:
(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window API_AVAILABLE(ios(6.0)) API_UNAVAILABLE(tvos);
I heard UIApplicationDelegate is on the chopping block so even if it does work who knows how long it'll work for (IMO AppDelegate still has useful APIs that scene delegates don't cover and certain things are really quirky to do in a scene delegate) .
I use a separate UIWindow to display some critical alerts too because injecting alerts in the UIViewController hierarchy can lead to some nasty bugs, especially if you run a network operation and get an error, the user might have hit a button and presented or pushed another view controller on screen in the in between but you really want to display that error. Separate UIWindow avoids a lot of potential problems about presenting on detached view controllers, interfering with the state of view controllers the error alert know nothing about, etc. ..But I let my alerts rotate.
Consider whether you really need to do this. Usually you should allow rotation in both windows but if you really can't you can try implementing the method above but note on iPad with resizable windows the concept of orientation doesn't make sense if you're not full screen.
If you're feeling really hacky I guess you could respond to the rotation in the alert window and just move everything where you want it to make it look like it's not rotating but I don't think I'd do that.