I had the same problem except it happened when calling dismiss on a PresentationMode in SwiftUI.
FWIW scheduling it on the next RunLoop worked for me:
RunLoop.main.schedule {
self.presentationMode.wrappedValue.dismiss()
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: