This must be bugs in the software. I opened the Product -> Scheme -> Manage Schemes... menu item and explored the configuration. I didn't change anything and when I closed the configuration window the preview was magically working.
Now when I close and open Xcode the preview works.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: