Here is what I have discovered:
When I have window A pushes window B, and then B's onAppear dismisses A by its id. In this case, A will not appear if B later dismisses itself unless B calls open/pushWindow(id: A)
However, if I then open an immersive space by A and dismiss it, there will be several B appearing depending on how many times the process I mentioned above was repeated
It does make no sense using onAppear to dismiss A while we later want to reuse it, but is this feature expected?