After much trial and error with this same problem, I found that cleaning the build folder (cmd + shift + K) makes this issue disappear.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: