How can I share cache with multiple users and roles?
Caching is shared with multiple users or roles by default, unless you add a cache context like user or user.roles.

Otherwise it's hard to tell what the code in the question wants to achieve.


If it wants to set block cache keys, then you can't do it from here
and you don't need to. They're set automatically.
get_agent_number_from_context() should probably be a custom
cache_context.agent_number which you then could add to the block
build array to vary the cached block by this variable: 

/**
 * {@inheritdoc}
 */
public function build() {
  $data = get_expensive_data();
  return [
    '#theme' =&gt; 'my_custom_module',
    '#data' =&gt; $data,
    '#cache' =&gt; [
      'contexts' =&gt; ['agent_number'],
      'max-age' =&gt; 86400,
    ],
  ];
}


How to create a custom cache context:
https://www.drupal.org/docs/8/api/cache-api/cache-contexts#recognize-discover-create
If it wants to cache the expensive data on its own (which
makes sense if you want to reuse the rendered result in other places
not necessarily blocks), then you need to execute
get_expensive_data() in a #pre_render callback to avoid that it
gets executed in case of a cache hit. See
https://dev.acquia.com/blog/drupal-8-performance-render-caching


Edit 1:
The cids you have added to the question contain a cache context for the user. I can't tell by the code shown so far how it ends up in your block. But there is also a cache tag of the user, so there has to be some code retrieving and rendering the current user.

Edit 2:
Assuming the theme is the same there is also a default user.permissions cache context for all render caching which probably kicks in now that user is removed. See https://www.drupal.org/project/drupal/issues/2493033