Xcode build fails in one project but not in another

I am trying to add a custom ProgressViewStyle to my project using the following code:

struct HorizontalProgressViewStyle: ProgressViewStyle {
    func makeBody(configuration: Configuration) -> some View {
        HStack(spacing: 8) {
            ProgressView()
                .progressViewStyle(.circular)
            configuration.label
        }.foregroundColor(.secondary)
    }
}

This code complies and functions in a new Multiplatform app project. However, when I copy the file into my existing (large) project I get the errors shown in the attached image.

I have no idea how to start debugging this, and the project is too large to start eliminating other files/changing settings.

I am using Xcode 14.0.1 and the project's minimal deployments is iOS 15.0

Any thoughts would be appreciated!

Xcode build fails in one project but not in another
 
 
Q