EAS Build failing for iOS because of apple-authentication

I am working on adding apple authentication to our app. I have already built it a few times successfully over the last couple of weeks, but starting today (which also implies the eas-cli@0.38.2 update) EAS build keeps failing on the Fastlane step with:

❌  error: Provisioning profile "*[expo] <bundleId> AppStore 2021-11-29T11:32:47.353Z" doesn't support the Sign in with Apple capability. (in target '<projectName>' from project '<projectName>')

❌  error: Provisioning profile "*[expo] <bundleId> 2021-11-29T11:32:47.353Z" doesn't include the com.apple.developer.applesignin entitlement. (in target '<projectName>' from project '<projectName>')

I’ve tried removing and regenerating the provisioning profile, both automatically and manually. No luck. I noticed that whenever I run EAS build, the App ID Configuration in the Apple developer console is changed, and the ‘Sign in with Apple’ capability keeps getting unticked. This happens regardless whether or not usesAppleSignIn is set to true under the ios key in app.json. If this flag is set, though, EAS keep warning to » ios: ios.usesAppleSignIn: Install expo-apple-authentication to enable this feature, even though the library is already installed.