Custom module template not detected
thanks to 4k4 comment, i have made it working

/**
 * Setting 40x template suggestions
 */
function amu_http_status_code_display_theme_suggestions_page(array $variables)
{
  $path_args = explode('/', trim(\Drupal::service('path.current')-&gt;getPath(), '/'));
  $suggestions = theme_get_suggestions($path_args, 'page');
  //mapping the route with its suggestion hook
  $http_error_suggestions = [
    'system.403' =&gt; 'page__403',
    'system.404' =&gt; 'page__404',
  ];
  $route_name = \Drupal::routeMatch()-&gt;getRouteName();
  if (isset($http_error_suggestions[$route_name])) {

    $suggestions[] = $http_error_suggestions[$route_name];
  }

  return $suggestions;
}




/*
 *
 * make drupal knows the templates are located in the module
 *
 * */
function amu_http_status_code_display_theme($existing, $type, $theme, $path) {


  $arguments403= array(
    'template' =&gt; 'page--403',
    'base hook' =&gt; 'page',
  );

  $arguments404= array(
    'template' =&gt; 'page--404',
    'base hook' =&gt; 'page',
  );

  //mapping the hook with its template
  return array(
    'page__403' =&gt;  $arguments403,
    'page__404' =&gt;  $arguments404,

  );
}