Repository: flutter
Issue: go_router doesn't honor errorBuilder for goNamed(), only for .go()
Labels: c: crash,package,has reproducible steps,P2,p: go_router,found in release: 3.3,found in release: 3.7,team-go_router,triaged-go_router

  go_router: ^6.0.0

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->
1. Define GoRouter with errorBuilder
```
final GoRouter router = GoRouter(

  errorBuilder: (context, state) => const ErrorPage(),
  routes: [..]
);
```
2. Call _context.go("/some/bad/path")_ and see the error page
3. Call _context.goNamed("nameThatDoesntExist")_ and no error page, but dumps error log



**Expected results:** <!-- what did you want to see? -->
Expected to see the error page when calling _goNamed()_

**Actual results:** <!-- what did you see? -->
no screen change, only error log


<details>
<summary>Code sample</summary>



```dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

final GoRouter router = GoRouter(

    errorBuilder: (context, state) => const ErrorPage(),
    routes: [
      GoRoute(
        name: "home",
        path: "/",
        builder: (context, state) => const HomePage(),
      ),
    ]
);

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});


  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: router,
      title: 'Flutter Demo',
      theme: ThemeData(

        primarySwatch: Colors.blue,
      ),

    );
  }
}
class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Homepage"),
      ),
      body: Center(
        child: Column(
          children: [
            ElevatedButton(
              onPressed: () => context.go("/does/not/exist"),
              // onPressed: () => context.goNamed("nothing"),
              child: const Text("bad"),
            ),
          ],
        ),
      ),
    );
  }
}



class ErrorPage extends StatefulWidget {

  const ErrorPage({super.key});

  @override
  State<ErrorPage> createState() => _ErrorPageState();
}

class _ErrorPageState extends State<ErrorPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        automaticallyImplyLeading: true,
        title: const Text("Settings"),
      ),
      body:  const Center(
          child: Text(" oops ")
      ),
    );
  }
}


```

</details>

<details>
  <summary>Logs</summary>



```
======== Exception caught by gesture ===============================================================
The following assertion was thrown while handling a gesture:
unknown route name: nothing
'package:go_router/src/configuration.dart':
Failed assertion: line 142 pos 12: '_nameToPath.containsKey(keyName)'

When the exception was thrown, this was the stack: 
#2      RouteConfiguration.namedLocation (package:go_router/src/configuration.dart:142:12)
#3      GoRouter.namedLocation (package:go_router/src/router.dart:174:45)
#4      GoRouter.goNamed (package:go_router/src/router.dart:201:9)
#5      GoRouterHelper.goNamed (package:go_router/src/misc/extensions.dart:32:25)

```


<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
 flutter analyze
Analyzing xyz...
No issues found! (ran in 3.4s)

```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```.
[!] Flutter (Channel @upstream, 3.3.10, on Microsoft Windows [Version 10.0.22000.1219], locale en-US)
    • Flutter version 3.3.10 on channel @upstream at C:\dev\languages\flutter
    ! Upstream repository unknown
    • Framework revision 135454af32 (6 days ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\dev\Android\sdk
    • Platform android-31, build-tools 30.0.3
    • ANDROID_HOME = C:\dev\Android\sdk
    • Java binary at: c:\dev\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.1)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33110.190
    • Windows 10 SDK version 10.0.20348.0

[√] Android Studio (version 2021.3)
    • Android Studio at C:\dev\Android\Android Studio
    • 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)

[√] Android Studio
    • Android Studio at c:\dev\Android\Android Studio
    • 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
    • android-studio-dir = c:\dev\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22000.1219]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 108.0.5359.99
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 107.0.1418.42

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->