I have not found a really good solution to this. For the time being, I just ignore the warning.
You may try to create your own modifier, where you would have the test for version.
https://www.hackingwithswift.com/books/ios-swiftui/custom-modifiers
Additionally, in a newer project, I don't have to include the if #available(iOS 17.0, *) { }, so I'm guessing the build is made for a newer iOS. If that's the case, would it not be compatible with older iOS versions?
It is not a question of new project. It is related to the minimum target you define.
Or you can set minimum target to iOS 17 (but not so good).