How can I show the flagging field edit form on a node?
Here's the code I ended up using:
/**
 * Implements hook_node_view() for MYMODULE.
 */
function MYMODULE_node_view(array &amp;$build, NodeInterface $node, EntityViewDisplayInterface $display, $view_mode) {
  if ($node-&gt;getType() == 'MY_CONTENT_YTPE') {
    if ($display-&gt;getComponent('my_flagging_form')) {
      $flag = \Drupal::service('flag')-&gt;getFlagById('MY_FLAG');
      $flagging_entity = \Drupal::service('flag')-&gt;getFlagging($flag, $node);
      $form = \Drupal::service('entity.manager')
        -&gt;getFormObject('flagging', 'edit')
        -&gt;setEntity($flagging_entity);
      $build['my_flagging_form'] = \Drupal::formBuilder()-&gt;getForm($form);
    }
  }
}

/**
 * Implements hook_entity_extra_field_info() for MYMODULE.
 *
 * Https://www.webomelette.com/creating-pseudo-fields-drupal-8
 */
function MYMODULE_entity_extra_field_info() {
  $extra = [];

  $extra['node'][NodeType::load('MY_CONTENT_TYPE')-&gt;Id()]['display']['my_flagging_form'] = [
    'label' =&gt; t('My flagging edit form'),
    'description' =&gt; t('This shows the my flagging edit form.'),
    'weight' =&gt; 100,
    'visible' =&gt; TRUE,
  ];

  return $extra;
}

For more details, see this question.