Navigation bar not hiding in iOS15

I have SwiftUI view set as the root view of a UIHostingController. This root view is then added as a subview of the view of a UIViewController. The UIViewController is a property on a parent view controller that deals with a UINavigationController.

The view in the body of the SwiftUI view, ends with: .navigationBarHidden(someBooleanProperty)

The intention is that when someBooleanProperty switches between true and false, the UIKit navigation bar is shown and hidden accordingly.

This works perfectly on devices running iOS14, but not with iOS15.

Any ideas why?

I've searched the internet for answers, but to no avail.

Navigation bar not hiding in iOS15
 
 
Q