How to put different page numbering in outline?

I’ve tried the “state-outline” trick shown by @xkevio . But in my case it works only, if I set the initial value of in-outline to true. This seems a bit strange to me. Shouldn’t it work, no matter, what the initial value is?

BTW: I’m using it in the header-definition of the page as follows:

header:  
      grid(
        ...
        text(font: heading-font, size: 9pt, 
          number-type: "lining",
          context {if in-outline.get() {
              counter(page).display("i")
            } else {
              counter(page).display("1")
            }
          }
        ),
        ...
      ),

Could that be the cause of the strange behavior?