How to set field value in custom webform submit handler?
Only now did I realize there is not only a submitForm method but also a presave method. I therefore changed my code as follows which is woking fine for me:
class CustomHandler extends WebformHandlerBase {

  use StringTranslationTrait;


  /**
   * {@inheritdoc}
   */
  public function preSave(WebformSubmissionInterface $webform_submission) {
    $this-&gt;submitMyFieldData($webform_submission);
  }


  /**
   * @param $webform_submission
   *
   * Manipulate data.
   *
   */
  private function submitMyFieldData($webform_submission) {
    $data = $webform_submission-&gt;getData();

    // to get a value from a form field
    $form_value = $data['my_field_machinename'];

    // to set the value of a form field
    $data['my_field_machinename'] = $form_value + 1;

    $webform_submission-&gt;setData($data);

  }