Managed Workflow: EAS Build fails for iOS but works with Expo Build

So we have recently switched to EAS builds for our app. The EAS build for android works perfect, but whenever we try to do EAS for iOS it fails at fastlane step with the following error

› Compiling react-native Pods/ReactCommon » TurboModuleUtils.cpp
› Compiling react-native Pods/ReactCommon » TurboModulePerfLogger.cpp
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸ 	PhaseScriptExecution [CP-User]\ Config\ codegen /Users/expo/Library/Developer/Xcode/DerivedData/Betra-gesfjyqjmatrdtaywhsotpbspers/Build/Intermediates.noindex/ArchiveIntermediates/Betra/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-config.build/Script-936F76AF67A004A694563C529216ABDC.sh (in target 'react-native-config' from project 'Pods')
▸ (1 failure)
** ARCHIVE FAILED **
The following build commands failed:
	PhaseScriptExecution [CP-User]\ Config\ codegen /Users/expo/Library/Developer/Xcode/DerivedData/Betra-gesfjyqjmatrdtaywhsotpbspers/Build/Intermediates.noindex/ArchiveIntermediates/Betra/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-config.build/Script-936F76AF67A004A694563C529216ABDC.sh (in target 'react-native-config' from project 'Pods')
(1 failure)
Exit status: 65

The build works fine locally.
I’ve tried upgrading fastlane and cocoapods version (It was failing with 1.10 which got fixed by passing latest version), added environment variables to secrets manager on expo for the build environment but nothing has helped till now.

Am i missing something here ?

Here’s my eas.json

{
    "build": {
        "development": {
            "releaseChannel": "staging",
            "distribution": "internal",
            "android": {
                "gradleCommand": ":app:assembleDebug"
            },
            "ios": {
                "buildConfiguration": "Debug",
                "cocoapods": "1.11.2",
                "fastlane": "2.198.1",
                "image":"latest"
            }
        },
        "preview": {
            "distribution": "internal",
            "android": {
                "buildType": "apk"
            },
            "ios": {
                "cocoapods": "1.11.2",
                "fastlane": "2.198.1",
                "image": "latest"
            }
        },
        "production": {
            "cache": {
                "key": "Invalidate"
            },
            "ios": {
                "cocoapods": "1.11.2",
                "fastlane": "2.198.1",
                "image": "latest"
            }
        },
        "preview-enterprise": {
            "distribution": "internal",
            "ios": {
                "enterpriseProvisioning": "universal",
                "cocoapods": "1.11.2",
                "fastlane": "2.198.1",
                "image": "latest"
            }
        }
    },
    "submit": {
        "production": {}
    },
    "cli": {
        "version": ">= 0.35.0"
    }
}

Here’s my latest BuildId: fb7dfb3d-002d-44d4-9fcc-7e98ef7231af

did you try building locally?