Repository: flutter
Issue: [go_router] Throws `registry.containsKey(page) is not true` in ShellRoute using rootNavigator when extendBodyBehindAppBar is true
Labels: package,a: error message,has reproducible steps,P2,p: go_router,found in release: 3.10,team-go_router,triaged-go_router,found in release: 3.13

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

Sorry, for now I have no clear steps.
I will try to come up with repro steps a little bit later.
For now this issue is for tracking purpose.

What I can see now is that the objects  and page keys are identical but hashes are not

### **Hashes in registry**

<img width="350" alt="image" src="https://github.com/flutter/flutter/assets/6721286/f2af6887-94d0-43d0-8bdb-3e15a8952158">


### **Page hash**
<img width="522" alt="image" src="https://github.com/flutter/flutter/assets/6721286/e8b776a8-c1c3-4c79-8a0b-9efad3bd8866">

The workaround it to use

```dart
   final router = GoRouter.of(this);
   final RouteMatch lastMatch = GoRouter.of(this).routerDelegate.currentConfiguration.last;
   final RouteMatchList matchList =
     lastMatch is ImperativeRouteMatch ? lastMatch.matches : router.routerDelegate.currentConfiguration;
   final String location = matchList.uri.toString();

   return location;
```

### Expected results

No errors in log.

### Actual results

```console
'package:go_router/src/state.dart': Failed assertion: line 211 pos 12: 'registry.containsKey(page)':
is not true.

The relevant error-causing widget was:
  Widget
 
When the exception was thrown, this was the stack:
#2      GoRouterStateRegistry._createPageRouteAssociation (package:go_router/src/state.dart:211:12)
#3      GoRouterState.of (package:go_router/src/state.dart:126:25)
```
### Code sample

<details><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E772610a darwin-arm64, locale en-UA)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Community Edition (version 2022.2.5)
[✓] VS Code (version 1.79.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

```

</details>