I thought I had found a bug that prevented counter() from working properly, but it was a feature!

https://css-tip.com/counter-gotcha/

Another CSS gotcha that you'd better know about if you don't want to waste time trying to figure out why your code isn't working.

Thanks to @mia@front-end.social for the insights