How to create custom node edit form protected function alterRoutes(RouteCollection $collection) {
    if($route = $collection-&gt;get('entity.node.edit_form')) {
      $route-&gt;setDefault('_entity_form', '\Drupal\alerts\Form\EditAdvisoryForm');
    }
  }

Causes a permission error. The logs say

Path: /node/1277957/edit?destination=/admin/content.
Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: in
Drupal\Core\Routing\AccessAwareRouter-&gt;checkAccess() (line 117 of
/app/web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).

It doesn't seem to prefill the form with the editable info. This is also not content type specific.
Please advise. Other posts close to this do not have an answer.
_entity_form doesn't accept a form class directly, only via a form handler. See https://www.drupal.org/docs/drupal-apis/routing-system/structure-of-routes

_entity_form: It is similar to _form, but it will provide an edit form for an entity. Entity form handlers are defined in the entity metadata
(annotation). For example, _entity_form: node.default will display the
default node form. &quot;node&quot; in node.default refers to the entity ID, and
&quot;default&quot; refers to the form handler key.