Old problem but strange things:Trying to backward through the graph a second time

This reminds me of this issue which raised a similar error.

Could you add the missing code parts to make the snippet executable, please?