It sounds like you are trying to have a global AppBar that is shared across different screens, is that correct?
IMO, each individual screen should have its own AppBar. The content in the app bar (the title, actions, etc.) is going to be screen-specific so each individual screen should own its app bar. You can make a shared Composable to provide consistent styling.
Then you also don’t need to worry about conditionally showing a back button if there are items on the back stack- for any given instance of a screen the back button should always be in the same state.