Xcodebuild command failing in Xcode 14, worked fine with Xcode 13

I am facing a issue while generating build using command line script in Xcode 14, the same script is working with Xcode 13. Please find the script

    # archieve the build
 ARCHIEVE_PATH="$BUILD_DIR/${ASSET_BASENAME}/$EXPORT_METHOD/${PRODUCT_NAME}.xcarchive"
    (xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -configuration "$CONFIGURATION" -destination 'generic/platform=iOS' -archivePath "$ARCHIEVE_PATH" clean archive 1> /dev/null ||
    xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -configuration "$CONFIGURATION" -destination 'generic/platform=iOS' -archivePath "$ARCHIEVE_PATH" clean archive ||
    failed "XCode failed to build app")

and I am getting following on the Jenkins console

` /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace BroughSuperior.xcworkspace -scheme BroughSuperior -configuration Release -destination generic/platform=iOS -archivePath "administrator/testing-app5_ios_2023-05-05-10:10:33/enterprise/testing-app5.xcarchive" clean archive

User defaults from command line: IDEArchivePathOverride = /Users/administrator/.jenkins/jobs/iOS Bruff dev/workspace/BroughSuperior/administrator/testing-app5_ios_2023-05-05-10:10:33/enterprise/testing-app5.xcarchive IDEPackageSupportUseBuiltinSCM = YES` Please help I can not use Xcode 13 now, since apple has stopped taking builds from Xcode 13. And the same command works in Xcode 13.

Please help this is very urgent. An early response is much appreciated.