In the docblock for hook_block_view:
/** * content: The content of the block's body. This may be a renderable array (preferable) or a string containing * rendered HTML content. */
But in the example code, both block examples return strings. Since a renderable array is preferred, at least one of the block examples should return a renderable array for its content.