May I ask if you’re still encountering this issue?
Furthermore, may I ask why would you want to redirect from xyz.pages.dev to example.com, instead rewriting your application to use example.com for static routes and routing? Souds like you’re trying to push the staging/development environment to production by force?
Have you tried using Rules instead, such as Transform Rules or Redirect Rules?