I am not 100% sure if that’s what happening, but I’d say during the first round, where you have set retain_graph=True and requires_grad=True, it keeps the graph intact for the 2nd round. And since it doesn’t (need to) rebuild the graph for the second round then, due to retain_graph=True, it would ignore any requires_grad setting.
But maybe @ptrblck and @smth
can tell you more about the mechanics (or correct my [mis]interpretation)