Switch Navigator not working properly in standalone build

Please provide the following:

  1. SDK Version:35
  2. Platforms(Android/iOS/web/all): iOS/Android

Switch navigation works perfectly in the expo client. If no valid token is found, the user is navigated to the authentication screen. However, in the standalone build, the app always loads directly to the main screen.

In trying to troubleshoot I created a new app with expo init. Selected the tab-template, added a login screen and added it to the switch navigator. I set the initialRouteName of the switch navigator to the login stack. Runs perfectly in the expo client.
I then ran expo build:android, downloaded the apk and installed on my phone. When I load the app, it loads directly to the home screen ignoring the initialRouteName property of the switch navigator

Same problem here. Works well in Expo client and APK, but in IPA it always redirects to Main screen regardless of initialRouteName.