Drupal 8 reference field default value from nid

Hi, iam trying to set default value to node reference field (autocomplete) from nid. 

For example my code is

$nid = Drupal::request()->query->get('field_event');
$node = is_numeric($nid) ? DrupalnodeEntityNode::load($nid) : NULL;

if ($node && isset($form['field_event'])) {
             $form['field_event']['widget'][0]['#target_id']['#default_value'] = $node;
        
       }

But the field doesn’t accept the default value.

Thank you for your suggestons.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed