Only the word "array" gets printed when I try to render custom block in template
You haven’t rendered the render array:

$output .= "&lt;div class=\"content\"&gt;".render($block['content'])."&lt;/div&gt;\n";