Hi, in Plone 6 (Classic-UI) there's the plone.app.redirector package, which tries to find old/new paths from moved objects, URL-aliases and so on before we see the Not found page.
Anyway the delivered 404 page template is located in Products.CMFPlone.browser.templates.error_message.pt which you can override with z3c.jbot (see the docs for overriding help).