Custom 404 error page issue
The trouble is, hook_page_alter() is called after your theme function is called.  So if you're setting things there it's too late.

I don't know why you're doing it this way.  Why not generate your suggestions in your page callback: mymodule_page_not_found().  Then pass them to the theme function.

Something like this:

/**
 * Implement hook_theme
 */
function mymodule_theme() {
  return array(
    'mymodule_page_not_found' =&gt; array(
      'template' =&gt; 'templates/404', // Not relevant to your question, but you should consider renaming this to mymodule-page-not-found because of a "bug" in D7; see discussion here: https://www.drupal.org/node/342350
      'variables' =&gt; array('suggestions' =&gt; array()),
    ),
  );
}

function mymodule_page_not_found() {
  // ... generate list of $suggestions ...
  return theme('mymodule_page_not_found', array('suggestions' =&gt; $suggestions));
}