How can I create custom error pages so that when a page is “not found” on the site, it returns this page http://199.245.231.22/sitemap.html instead of the generic MODx template?
Just create your sitemap as modx document. Hide it in your menus by un-checking Show in menu.
Go to your Tools/Configuration and enter the page id in "Error page" field.
If you want to redirect to different domain or page that is not in modx just create a modx page and use the sendRedirect API in a snippet.
Eg: $modx->sendRedirect(’http://www.google.com’);