The trouble with assumptions

Agree with both. Brain fart on my part. Can’t count on counter++ and counter-- being atomic. Simply surrounding them with noInterrupts() / interrupts() pair would fix that.

When I pointed out the flaw in the original code, I explained the problem in detail so the OP could understand. Like I said, my brain fart missing the follow-on issue.
Don’t know why @CB chose to be a jerk and recommend guessing games (“go search for my posts on the internet”) instead of providing a concise explanation.

I do not gladly suffer laziness. You could have, literally, used keywords from the thread to perform the search.

Thank you.

And the ISR begins with interrupts disabled. The variable must be volatile.

If the incrementing is done in the ISR, reading the count without cli() ... sei() would get the very latest count that might update RAM before the sketch reads RAM.

I must have been busy with RL, arrived after the damage was done yet it took a lot of time to find that the trail had been wiped yet kept on going.