Random D3DCompile exception

Hi, here is a little video of the problem - YouTube . As you can see the material doesn’t compile properly at first, but works on the second try (and I was lucky there).
Unfortunately I can’t provide a simple material to reproduce this. But it happened several times on totally unrelated codes and different systems.