Thank you @emovla, removing the @Environment(.dismiss) (which was unnecessary anyway in my case) fixed it for me.
Post
Replies
Boosts
Views
Activity
On Xcode 15.0 I've found you now have to right click on the code to see these options.