It seems that you are forgotten to pass the r_in.time into the constructor of the scattered ray in some of materials. 