I had a similar issue. My macOS framework tests couldn't be executed anymore via xcodebuild on macOS Sequioa with Xcode 16.1. Everything was fine on macOS Sonoma however. The custom -derivedDataPath points to a subfolder inside the project directory and it turns out that Xcode didn't have the rights to write an executable inside my Documents directory and its subfolders. After giving Xcode 'Full Disk Access' (Privacy & Security) the unit test bundle is now created correctly as an executable and the tests run fine again.
Funny enough this only affects the macOS build target, not the other platforms (iOS, tvOS, watchOS etc). Additionally I could reproduce the issue in a freshly created dummy project.