How to clear form element values after validation error
Have you looked at unsetValue()?

Example usage:

public function validateForm(array &amp;$form, FormStateInterface $form_state) {
  ...
  if (!$authorized) {

    $this-&gt;messenger-&gt;addError($this-&gt;t('An error occurred.'));

    $form_state-&gt;unsetValue('name');

   }
 }


From the doc:


  Removes a specific key from the submitted form values.
  
  
  @param string|array $key
  Values are stored as a multi-dimensional associative array. If $key is a string, it will use unset($values[$key]). If $key is an array, each element of the array will be used as a nested key. If $key = array('foo', 'bar') it will use unset($values['foo']['bar']).