Reset View result counter after changing page (manually or with Twig)
It doesn't work because counter is actually an object with the value as a property, that's done to properly handle markup or special characters and preventing them from being escaped multiple times.

Depending on what template you're overriding and where, you could possibly do this in twig, especially if you are where you are loop over the rows already, although that might be a bit complicated.

My/the backend developer approach would be to make your own counter views field/plugin that doesn't consider the pager. This logic happens in \Drupal\views\Plugin\views\field\Counter::getValue(). So you can copy this  class into a custom module, rename to NoPagerCounter or so, and change the annotation to @ViewsField("no_pager_counter"). Then you remove the pager related part in the getValue(). Now you just need to implement hook_views_data() and define this as a field, just like views_views_data does with the counter:

  $data['views']['no_pager_counter'] = array(
    'title' =&gt; t('View result counter (no pager)'),
    'help' =&gt; t('Displays the actual position of the view result'),
    'field' =&gt; array(
      'id' =&gt; 'no_pager_counter',
    ),
  );


(Possibly with a better title/help, I just switched the ids)

Another variant of that would be to add an option for this to the existing class and provide a core patch/feature request for this. If others agree that it is useful then it might eventually get committed and you don't need to maintain custom code, but you will have to maintain the patch until then.