Conditional menus based on page title

As you can read from the documentation register_nav_menu is used to register a menu in the menu editor. Your code will affect the backend only. Also you should pass a slug like string as the first parameter. If you want to change the display of the menu, you could simple write a condition which will change the parameters of wp_nav_menu. Like the following:

// header.php (or similar)
wp_nav_menu([
  'menu' => (is_page('about-us') ? 'primary-navigation' ? 'example-menu'),
]);

Otherwise you could also register a menu and change the value of the theme_location parameter to make the menu configurable by the user.

Update:

To achieve this via a filter hook

// functions.php
add_filter('wp_nav_menu_args', function ($args) {
  if (is_page('about-us')) {
    $args['menu'] = 'my-custom-menu';
  }
  return $args;
});

error code: 523