Gradients or parameters exchange

I saw your comment in the other thread, but could you provide a minimal script to reproduce the behavior?