Template Switch turn_off doesn‘t get executed

Could you please post how that would look like?

Try to implement what I had suggested; it will be more satisfying, and you’ll learn more, than if I do it for you.

My advice:

Make a button entity that triggers the automation / script for you. Don’t use a switch to govern the other switch. It’s confusing, it’s messy, and the action you are running is a one-off anyway (“momentary power off”) so a button is conceptually the correct thing to use.