I didnt change the bar color through react-navigation. I figured out the problem. I set <StatusBar hidden /> on App.tsx file, also react-native-screens stack options setStatatusBarHidden:true. I removed setStatusBarHidden:true error disappeared. It wasnt a problem for sdk 39. Somehow it causes conflict in sdk 40.
i see, so you were manipulating the status bar through react-native-screens. indeed that requires setting uiviewcontroller based status bar, which is not enabled in the managed workflow.