how making a selection from a taxonomy selector fixed definitively

The wp_dropdown_categories function provides the HTML for a list of taxonomy terms based on the values assigned to its parameters. That is all it does. When users select a value from the taxonomy selector, the selected value is not saved to the database unless the developer saves it. As the developer, you need to decide to save it, and where it should be saved. A function that saves the selected value to the database is missing from your code.

When the user submits the form, the taxonomy selector value can be saved as a post meta value.

In your code, $selected_terms gets its value(s) from wp_get_post_terms. wp_get_post_terms finds the taxonomy terms for the current post, not the last option selected from the taxonomy selector.

So, the code needs to 1. display the form; and 2. save the value(s) from the form.

Display the form

The WordPress documentation for wp_dropdown_categories indicates the data type for the selected parameter is int|string. Your code assigns $selected_terms which is an array. If multiple selected options are allowed the wp_category_checklist function should be used. The code below assumes that multiple selected options are not allowed. Only a single option can be selected.

Remove default meta boxes

See remove_meta_box in the WordPress documentation.

/**
 * Prevent the large meta boxes from appearing in the main
 * area of the Edit Post page.
 */
function remove_custom_meta_forms() {
    remove_meta_box( 'postcustom', 'post', 'normal' );
    remove_meta_box( 'postcustom', 'page', 'normal' );
    // remove_meta_box( 'postcustom', 'CUSTOM_POST_TYPE', 'normal' );
}
add_action( 'admin_menu' , 'remove_custom_meta_forms' );

Register post meta data field for use with REST API (optional)

If you are using a custom post type, update the object_subtype property.

/**
 * Register tax_input[numero_ospiti] field if you want it
 * to be available via WordPress REST API.
 */
function register_tax_input_ospiti() {
    \register_meta(
        'post',
        'tax_input[numero_ospiti]',
        array(
            'object_subtype'    => 'post',
            'description'       => 'Count of guests.',
            'single'            => true,
            'type'              => 'integer',
            'show_in_rest'      => array(
                'schema' => array(
                    'type'  => 'integer'
                )
            ),
            'default'           => 0,
            'sanitize_callback' => function( $value ) { return $value; },
            'auth_callback'     => function() { return '__return_true'; }
        )
    );
}

Display taxonomy selector

function custom_meta_box_markup( $post ) {
    $post_id = $post->ID;

    // tax_input[numero_ospiti] is an array,
    // but managed as a single value.
    $is_single_value = true;

    // Retrieve the term name that was saved to the database.
    $selected_term_name = get_post_meta( $post_id, 'tax_input[numero_ospiti]', $is_single_value );
    $terms = get_terms( array(
        'taxonomy' => 'numero_ospiti',
        'fields'   => 'id=>name',
        'hide_empty' => false,
        'number'   => 0
    ) );

    $flipped_terms = array_flip( $terms );
    if ( isset( $flipped_terms[ $selected_term_name ] ) ) {
        $selected_term_id = $flipped_terms[ $selected_term_name ];
    } else {
        $selected_term_id = 0;
    }

    $set_referer_field = true;
    $echo_html = false;
    $wp_nonce_html = wp_nonce_field(
        basename( __FILE__ ),
        'meta-box-nonce',
        $set_referer_field,
        $echo_html
    );

    $args = array(
        'taxonomy'   => 'numero_ospiti',
        'selected'   => $selected_term_id,
        'name'       => 'tax_input[numero_ospiti]',
        'hide_empty' => false,
        'echo'       => false
    );
    $dropdown_cat_html = wp_dropdown_categories( $args );

    $html = <<<EOHTML
    <div>
        $wp_nonce_html
        <label for="meta-box-ospiti">N.ospiti</label>
        $dropdown_cat_html
    </div>
    EOHTML;

    echo $html;
}

function add_custom_meta_box() {
    add_meta_box(
        'demo-meta-box',          // Unique ID.
        'Ospiti',                 // Meta box title.
        'custom_meta_box_markup', // Content callback, must be of type callable.
        'post',                   // Screen type.
        'side'                    // Context: where meta box should display in the screen.
    );
}
add_action( 'add_meta_boxes', 'add_custom_meta_box' );

Save value(s) from the form to database

/**
 * Update post meta data.
 *
 * @param int $post_id Post ID of post being saved.
 */
function save_custom_meta_box( $post_id ) {
    if (
        isset( $_POST ) &&
        isset( $_POST['tax_input'] ) &&
        isset( $_POST['tax_input']['numero_ospiti'] )
    ) {
        $term_id = $_POST['tax_input']['numero_ospiti'];
        $terms = get_terms( array(
            'taxonomy'   => 'numero_ospiti',
            'fields'     => 'id=>name',
            'hide_empty' => false,
            'number'     => 0
           ) );
        $selected_term_name = $terms[ $term_id  ];

        update_post_meta(
            $post_id,
            'tax_input[numero_ospiti]',
             $selected_term_name
        );
    }
}
add_action( 'save_post', 'save_custom_meta_box' );