cycles - different effects when order switched, even with opposite factor
Before giving you the solution, you need to understand somethings from Cycles..

When a ray from the camera is thrown to the scene, this ray will be tagged with 'is_camera_ray'!
As soon as the ray hits some object in the scene, a bunch of other rays are created, depending on the type of shader that object has (glossy rays, diffuse rays, etc).



Cycles first tries to check if the sample point on the hit object is illuminated by some light, so it throws a shadow ray directly to each light.

If this shadow ray hits another object before hitting the light, then you get a shadow of the second object in the first object.

The exception to this result is if the second object has a Transparent shader in it.

This will let the ray to continue its path to the light, and in return, the amount of light is multiplied by the transparent shader color.

This means that a transparent shader with a full white color will let all the incoming light to pass through the second object and the sample point in the first object will be fully illuminated.

Having a (0.5, 0.5, 0.5) color in the shader, will block half of the incoming light, and a transparent color of black, will block all the light in that path, which is the same behaviour of all other shaders.

Now, having a Transparent shader in the node_tree will also make it transparent to all other rays, inclusive the camera rays. To avoid this we make a switch from original material to a transparent shader only when the ray is shadow ray.

That's why we don't multiply the is a shadow ray by anything, as we want the transparent behaviour for shadows (1) and normal behaviour for everything else (0).

If you multiply the is shadow ray by 0.5, it just means that shadows rays will see 50% the top shader, and 50% the bottom shader, while all other rays will only see the top shader. 

In this situation, any shadow ray will put a 1 in the is shadow ray output, which will make the Mix Shader node to output the Transparent shader instead of the Diffuse shader (which is the one visible to any other types of rays).

Since the Transparent shader has a color of white, the light will simply pass through and no shadow will be produced. Changing the transparent color will change the amount of light (and coloring it).

Solution:
Just animate the color of the Transparent shader.

read more in docs.blender.org