Anchor links to views grouping field titles
I think this may be a template modification task.

This is the current views-view-unformatted.html.twig file:

{% if title %}
  &lt;h3&gt;{{ title }}&lt;/h3&gt;
{% endif %}
{% for row in rows %}
  {%
    set row_classes = [
      default_row_class ? 'views-row',
    ]
  %}
  &lt;div{{ row.attributes.addClass(row_classes) }}&gt;
    {{ row.content }}
  &lt;/div&gt;
{% endfor %}


Switch:

&lt;h3&gt;{{ title }}&lt;/h3&gt;


With:

&lt;h3 id="{{ title | clean_class }}"&gt;{{ title }}&lt;/h3&gt;


This would require your titles to all be unique to ensure unique ID's. There may be something better to use than "title" for the ID as well in this case.

Also, I would wonder if using an "attachment" in the view might give better options and control over a block for the table of contents...