Strange Page not Found, Permissions, Clear cache On my D7.80 I have developed a custom module:
    function wrong_answer_menu() {
    dd('it entered in hook menu');
  $items['wrong-answer/%id'] = array(
    'title' =&gt; t('Wrong Answer Dashboard'),
    'page callback' =&gt; 'wrong_answer_dashboard',
    'page arguments' =&gt; array(1),
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_LOCAL_TASK,
  );

  return $items;
}

/**
 * Callback: hook_menu.
 */
function wrong_answer_dashboard($node_param=NULL) {
dd('it entered in dashboard');
....
}

Everything was fine, I was developing the menu nicely accessing the
mydomain.com/wrong-answer
and everything was fine.
Then I wanted to add permissions to my custom module, so that only the admin can access this page hence I added the wrong_answer_permission function and in the dashboard function I checked if the user had permission to access the page
/**
 * Implements hook_permission().
 */
function wrong_answer_permission() {
  return array(
    'wrong_answer_' =&gt; array(
      'title' =&gt; t('View the wrong answer'),
    ),
  );
}

    function wrong_answer_dashboard($node_param=NULL) {
     dd('it entered in dashboard');
     if (!user_access('wrong_answer_admin')) {
      return;
     }
    ....
    }

At this stage, when I accessed the page mydomain.com/wrong-answer I could still access it even though I did not assign the permission to it. Then I cleared the cache from the Performance menu via the admin/config/development/performance, and then I got the error message
The requested page &quot;/wrong-answer/717&quot; could not be found.

I get the same error for acessing just mydomain.com/wrong-answer.
Then I thought it was all fine, I added the permission wrong_answer_admin to the admin role, but then I still got the same error &quot;The requested page .... could not be found.
Afterwards, I:

cleared the cached
removed the code that I had added on the permission and checking the user access
rebuild the registry_file by emptying the table and running the update.php
assigned the permission to the wrong_answer_admin to all the roles, including anonymous role
deleted the wrong_answer_admin row in the permissions table in the database
disabled and re-enabled by custom module

but nothing worked, I still get the error &quot;The requested page cannot be found&quot;.
Then I noticed the strangest thing, that whenever I would clear the cache at, I would would get an entry in the drupal_debug.txt
it entered in hook menu

I do not get this entry in the drupal_debug.txt when accessing the wrong-answer page, I only get it when clearing the cache.
Could you please help me understand what is going on? why can't I access the wrong-answer page anymore?
Many thanks
An answer to part of your question:

Then I noticed the strangest thing, that whenever I would clear the
cache at, I would would get an entry in the drupal_debug.txt
it entered in hook menu
I do not get this entry in the drupal_debug.txt when accessing the
wrong-answer page, I only get it when clearing the cache.

If Drupal built the menu for every page load, it would result in heavier page loads. As such, hook_menu() is only called after the cache is cleared, as the menu cache is rebuilt the first time it is needed and no cache exists. Once it's been cached, hook_menu() does not get called anymore.