Repository: next.js
Issue: Navigating out of "Not Found" page gives error if Parallel routing exists
Labels: bug,Navigation,Parallel & Intercepting Routes

### Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/gallant-kalam-2xqmnr?workspaceId=08193210-3c43-4dee-852a-15fcfd6a6e98

### To Reproduce
Fork the sandbox to see error in terminal.

If you have parallel routes defined somewhere in the project and put it inside layout, eventhough it successfully redirects, nextjs throws error when inside notfound page with a link. 

I have tried my best to log what's undefined at 0 index, NextJS gives this :
{ children: [ '/_not-found', { children: [Array] } ] } children
{ children: [ '/_not-found', { children: [Array] } ] } testRoute

it tries to reach parallel route slot name but only has children.

In order to replecate the issue : 
1 - Have a parallel route and a interceptor route inside
2 - ```<Link>``` inside notfound page.
3 - Go to notfound page (force nextjs give not found- go to any route that doesn't exists)
4 - click on the link.

```
 ⨯ next/dist/src/server/app-render/walk-tree-with-flight-router-state.tsx (238:50) @ walkTreeWithFlightRouterState
 ⨯ TypeError: Cannot read properties of undefined (reading '0')
    at async doRender (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/base-server.ts:2660:21)
    at async responseGenerator (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/base-server.ts:3021:21)
    at async DevServer.renderToResponseWithComponentsImpl (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/base-server.ts:3033:23)
    at async DevServer.renderPageComponent (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/base-server.ts:3613:15)
    at async DevServer.renderToResponseImpl (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/base-server.ts:3675:23)
    at async DevServer.pipeImpl (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/base-server.ts:1698:20)
    at async NextNodeServer.handleCatchallRenderRequest (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/next-server.ts:1046:6)
    at async DevServer.handleRequestImpl (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/base-server.ts:1463:8)
    at async (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/dev/next-dev-server.ts:512:13)
    at async Span.traceAsyncFn (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/trace/trace.ts:143:13)
    at async DevServer.handleRequest (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/dev/next-dev-server.ts:510:19)
    at async invokeRender (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/lib/router-server.ts:284:10)
    at async handleRequest (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/lib/router-server.ts:530:15)
    at async requestHandlerImpl (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/lib/router-server.ts:576:6)
    at async Server.requestListener (node_modules/.pnpm/next@15.0.4-canary.31_react-dom@19.0.0-rc-b01722d5-20241114_react@19.0.0-rc-b01722d5-20241114/node_modules/next/src/server/lib/start-server.ts:152:6) {
  page: '/'
}
  236 |         subPath[0] === DEFAULT_SEGMENT_KEY &&
  237 |         flightRouterState &&
> 238 |         !!flightRouterState[1][parallelRouteKey][0] &&
      |                                                  ^
  239 |         flightRouterState[1][parallelRouteKey][3] !== 'refetch'
  240 |       ) {
  241 |         continue
  ```

### Current vs. Expected behavior

Current:
Throws an error. 

Expected:
Should not throw an error

### Provide environment information

```bash
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.0.4-canary.31 // Latest available version is detected (15.0.4-canary.31).
  eslint-config-next: N/A
  react: 19.0.0-rc-b01722d5-20241114
  react-dom: 19.0.0-rc-b01722d5-20241114
  typescript: 5.3.3
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Navigation, Parallel & Intercepting Routes

### Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local), Other (Deployed)

### Additional context

We are currently using ^14 in production the issue exists. My sandbox (attached to issue) is ^15 canary.31 still have this issue.

![image](https://github.com/user-attachments/assets/5dfc85fe-7c07-487f-9361-53cc3ded3a93)