I fixed it by not using UIViewController on the page.
Don't know that was the exact problem though since the view was dismissing at seeming completely unrelated timing.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: