Programmatically update Webform Submission by sid
Try using \Drupal\webform\WebformSubmissionInterface::getData(); and 
\Drupal\webform\WebformSubmissionInterface::setData($data);

// Load submission using sid.
/** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */
$webform_submission = \Drupal\webform\Entity\WebformSubmission::load($sid);

// Get submission data.
$data = $webform_submission-&gt;getData();

// Change submission data.
$data['element_key'] = 'custom_element_value';

// Set submission data.
$webform_submission-&gt;setData($data);

// Save submission.
$webform_submission-&gt;save();


Update: Use a capital "E" in "Entity" for the class name. (Recently got updated).