How to copy current user'id to a custom field when adding a new entity?
You probably want to use the setValue() function, like this:

$user = \Drupal::currentUser();      
$node-&gt;FIELD_NAME-&gt;setValue(['value' =&gt; $user-&gt;id());