Make sure you've gone through the latest SwiftUI talk from 2021 WWDC where they discuss state persistence and how it ties to view identity. There are, unfortunately, a lot of ways for SwiftUI to lose track of a view's state.
You might also check out my article Deep Inside Views, State and Performance in SwiftUI. https://medium.com/swlh/deep-inside-views-state-and-performance-in-swiftui-d23a3a44b79