Cannot set Sonoff mini

Good day everyone.

I’m trying to set up a Sonoff mini. It is used to monitor the status (I do not know what this function is called elsewhere in the world) of low (cheap) and high (more expensive) tariff.
For ease of explanation, I uploaded a video.

From the beginning, the relay works properly, exactly as required. The remote control signal is present “ON” = Sonoff mini is also correctly ON. Then I simulate by disconnecting the orange relay the remote control signal is not present “OFF” = Sonoff mini again correctly “OFF”
Everything seems to be fine, but I simulate the failure by turning off the power of the Sonoff mini, which I have set to “OFF” after power recovery (logic such that the mini is OFF after power recovery and switches to ON if the remote control signal is present), when power is restored, it switches to completely opposite mode. Remote control signal ON = Sonoff mini output OFF.

There is an option to set so that in all circumstances it is always:
Remote control signal ON = Sonoff mini ON
Remote control signal OFF = Sonoff mini OFF.

I apologize for burdening this forum, and at the same time for Google Translate.
I have been dealing with this problem for a long time and I cannot solve it to my satisfaction.

Thank you for your help