Variable "darkmode_active" of "Advanced Conditions" isn't always effective

Scene

Define a automation that is when the "Pdf Expert" app is activated then trigger a "Menubar-item".

The content of "Menubar-item" is: when the system appearance is in dark mode, then switch the App theme from light to dark.

Problem

The auto switch action commonly is not effective, only opens BTT configuration after "Pdf Expert" app has been activated.