Hello,
I will log this internally, this is definitely a bug.
However, there is a workaround if you keyframe all problematic frames (all those before the last material change), by pressing the material tag material selection animation node, it will work correctly.
Additionally, if you set the Animation Dope Sheet interpolation to Step (attaching image), this will also fix the issue.
Let me know if I'm not making sense.
Thanks,
Jan