[backport] Fix catch-all index page being served for every other slug (#97416)
Backports [Fix catch-all index page being served for every other
slug](https://github.com/vercel/next.js/pull/96553) to `next-16-3`.
<!-- NEXT_JS_LLM -->
Co-authored-by: Andrew Clark <git@andrewclark.io>