How to programmatically render a webform to display specific Elements
To hide custom field in webfrom you need to use the hook_form_FORM_ID_alter. 

function CUSTOM_MODULE_form_webform_submission_request_form_add_form_alter(array &amp;$form, FormStateInterface $form_state, $form_id) {
  $elements = &amp;Drupal\webform\Utility\WebformFormHelper::flattenElements($form['elements']);

  $elements['flexbox_layout']['confirmation_id']['#access'] = FALSE;
}



To get specific form elements you can use getSubmissionForm() method:

public function buildForm(array $form, FormStateInterface $form_state, $sid = NULL) {
  $my_webform_machinename = 'request_form';
  $my_form = \Drupal\webform\Entity\Webform::load($my_webform_machinename);

  $webform = $my_form-&gt;getSubmissionForm();

  $form['my_field'] = $webform['elements']['flexbox_layout']['confirmation_id'];

  return parent::buildForm($form, $form_state);
}