I didnt understand the second approach,sorry. for the first i think you tried assuming that introducnig y into the graph somehow would cause gradient flow. however you use y[0] as well as - y[0] which admit opposite gradient flows that cancel each other.
even without going into details of gradient flow, the statement essentially is the same as x_noleaf[0] = x_noleaf[0] which shouldnt have helped if you think about it.
i think you are trying elbow in gradients, while the overall consideration of why gradients should flow and if indeed they will be useful for reducing the loss you are interested in is getting lost.