For me it was that i was building project with xcodebuild on github actions on M3 or something (macos-latest), but the project required building for Rosetta simulator due to its libs.
I have changed the environment to macos-13 that uses intel and that was the fix