You have to take into account that the counter memory of %_max_counter%, when reading immediately after a loop, the counter is automatically set to zero ... I think so.
Obviously by your example, the counter runs into trouble when called without a previous loop, so it starts counting for itself.
There are two mte scripts attached, which demonstrates the behaviour of %_max_counter% in different coding situations. __Export.MaxCounter.Anomalie.1.mte (529 Bytes)__Export.MaxCounter.Anomalie.2.mte (591 Bytes)
Thanks D, but my example's calls all are with a previous loop. The failing ones are without an immediately preceding loop, but this should not affect the result. My usage accords with: