Redirect for anonymus user doesn´t work from Controller
Try this

&lt;?php

namespace Drupal\testmodule\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\RedirectResponse;

class EntityChecker extends ControllerBase {

  public function redirectToFront($bundle, $label) {
    $response = new RedirectResponse("/");
    $response-&gt;send();
  }

}