Animated matte generator bug (PLSSS HELP)

Can someone please explain this? Why is it not working right?