Is it possible to dynamically register menus?

Register a menu is really register a menu location, but I think you don’t need to register locations so you can avoid the register step. I think what you need is wp_nav_menu( ) function. For example, in the page template:

//Get the menu slug stored in page custom meta field
//Replace menu_meta_field_name with the correct name of the meta field
$menu_slug = get_post_meta( get_queried_object_id(), 'menu_meta_field_name', true);
wp_nav_menu( array( 'menu' => $menu_slug ) );

error code: 523