Block caching issue on twig
You have to render the content build() returns:

block.html.twig:

...

{{ content }}


Even if it's only an empty markup string. Otherwise the cache max-age can't bubble up.

A better approach would be to return from build() a custom template, which you use for the html markup instead of the block template. See https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-from-custom-module

Then you don't need a preprocess hook and caching works with the default block template.