It may be that your project is continuing to support older platform versions. At least, mine is, and adding an @available attribute to the macro resolved it:
@available(iOS 17.0, *)
#Preview("Small", as: .systemSmall) {
... etc ...
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: