Hello! I'm glad to hear that you're enjoying your migration to Astro.
The issue you're experiencing might be related to the way Astro handles custom 404 pages in production. In development, Astro can serve your custom 404 page correctly, but in production, it might not behave as expected. This is a known issue that has been reported in the Astro GitHub repository (source (https://github.com/withastro/astro/issues/4113)).
As for displaying the original or redirected path in the custom 404 page, it seems that Astro doesn't currently support this feature out of the box. There's a discussion on a similar topic in the Astro GitHub repository, where a contributor suggested a workaround by rendering an Astro component from within the page (source (https://github.com/withastro/astro/issues/4635)). However, this might not be the ideal solution for your case.
For your future plan to add a feature that searches for existing pages similar to the non-existing page, you might need to implement a custom solution, as Astro doesn't provide this feature natively.
I recommend keeping an eye on the Astro GitHub repository for updates on these issues and potential new features. You can also consider contributing to the project if you have a solution in mind. Astro is an open-source project and contributions are always welcome!
I hope this information helps! Let me know if you have any other questions.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: