diff --git a/core/modules/workspaces/src/Controller/WorkspacesHtmlEntityFormController.php b/core/modules/workspaces/src/Controller/WorkspacesHtmlEntityFormController.php
index 6f9d6d5b65..f6d8af6003 100644
--- a/core/modules/workspaces/src/Controller/WorkspacesHtmlEntityFormController.php
+++ b/core/modules/workspaces/src/Controller/WorkspacesHtmlEntityFormController.php
@@ -13,6 +13,7 @@
 use Drupal\workspaces\Plugin\Validation\Constraint\EntityWorkspaceConflictConstraint;
 use Drupal\workspaces\WorkspaceInformationInterface;
 use Drupal\workspaces\WorkspaceManagerInterface;
+use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -33,7 +34,7 @@ public function __construct(
   /**
    * {@inheritdoc}
    */
-  public function getContentResult(Request $request, RouteMatchInterface $route_match): array {
+  public function getContentResult(Request $request, RouteMatchInterface $route_match): array|RedirectResponse {
     $form_arg = $this->getFormArgument($route_match);
     $form_object = $this->getFormObject($route_match, $form_arg);
 
