Without logs, I think the problem you’re having is a “contact changes to” paired with a “wait 10 seconds” in your next statement. Inside webCoRE, the flow goes something like this:
You close your window within the time restriction, satisfying both your conditions, so your piston begins to execute your WITH statement.
When it reaches the WAIT 10 seconds, your piston sets a wake-up call for itself 10 seconds in the future.
Ten seconds later, you piston wakes up and checks your conditions again. Since “contact changes to closed” only evaluates true for ~10 seconds, it probably JUST misses the window, evaluates false, and your shade is not activated. This is also why if you open and close it a second time, it works… the “time to expire” is renewed on your “contact changes to closed”, so it evaluates true.
The easiest way around this is to change your “contact changes to closed” condition to “contact stays closed for 10 seconds”. Then if you find you want to extend the 10 seconds to something even longer, it can easily be done.