Solved
Here is the bug shown with a very simplified example. It has to do with the nested loops (which should have no effect whatsoever in this example). Omitting either loop will make it work.

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

