This is Sod's Law. It also happens when I'm trying to get a perfect shot in the sunshine. The sun goes in just as I'm in position. I wait for it to come out again. I wait some more. I give up. Walk away.
Just when I'm far enough away to not get back quickly, the sun comes out. I run back to the perfect spot. The sun goes in.
Sod's Law.