WordPress menu deletes when trying to add a hook

I don’t think there’s wp_nav_menu action. Perhaps you want the wp_nav_menu filter (doc)?

function custom_novice_menu($args) {
    if( 'primary' == $args['theme_location'] ) // only apply to the right menu
    {
        $args['container'] = 'div';
    }

    return $args;
}

add_filter('wp_nav_menu', 'custom_novice_menu');