Repository: flutter
Issue: [go_router] StatefulShellBranch glitch when I try to push an inner route from the other route
Labels: package,P2,p: go_router,team-go_router,triaged-go_router

`go_router: ^13.0.1`

### Steps to reproduce

I went to /dev screen and tried to push /wallet/card-ready-banner-child from it

### Expected results

This screen is just pushed on the top of the root navigator stack.

### Actual results

Some assertion fails
<img width="1132" alt="image" src="https://github.com/flutter/flutter/assets/12999702/3bd28097-23ea-4d5d-8a31-f0c454914fcd">

When I'm repeating it the 2nd time, there's an another error:
<img width="1066" alt="image" src="https://github.com/flutter/flutter/assets/12999702/b0158e51-692a-4bfc-984a-a7905d70d1ea">


### Code sample

<details open><summary>Code sample</summary>

I've created the following setup:
<img width="534" alt="image" src="https://github.com/flutter/flutter/assets/12999702/bdd1c26d-0794-43cf-b98f-986c5e139dab">

</details>


### Router setup

<img width="650" alt="image" src="https://github.com/flutter/flutter/assets/12999702/9a7abc78-eab9-4d5d-917d-ac27c8aa4a72">


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.16.2, on macOS 13.0.1 22A400 darwin-arm64, locale ru-RU)
    • Flutter version 3.16.2 on channel stable at /Users/svmolchan1/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9e1c857886 (6 weeks ago), 2023-11-30 11:51:18 -0600
    • Engine revision cf7a9d0800
    • Dart version 3.2.2
    • DevTools version 2.28.3

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/svmolchan1/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.85.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (3 available)
    • M2101K9AG (mobile) • cc706425 • android-arm64  • Android 13 (API 33)
    • macOS (desktop)    • macos    • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm64
    • Chrome (web)       • chrome   • web-javascript • Google Chrome 116.0.5845.96

[✓] Network resources
    • All expected network resources are available.
```

</details>