This error may occur while setting up custom entities. I encountered it while setting up a custom action link with a confirmation form for this entity.

Possible solution: make sure you add the form definitions in the main definition of your entity type. The form and links should be defined in the structured comment section of @ContentEntityType.