Call to a member function toArray() on null 📋

Error
Toggle Vendor Stack Frames
     * @throws \UnexpectedValueException If return value of action is not `null` or `ResponseInterfaceinstance.
     */
    public function invokeAction(Closure $action, array $args): void
    {
        $result $action(...$args);
        if ($result !== null && !$result instanceof ResponseInterface) {
            throw new UnexpectedValueException(sprintf(
                'Controller actions can only return ResponseInterface instance or null. '
                'Got %s instead.',
Error in: ROOT/src/Controller/EventsController.php, line 258

If you want to customize this error message, create templates/Error/error500.php