Hi,
The problem is that your function is linear. So the first gradient is constant and the second order gradient is independent of the input.
This error message happens because of the independence (and thus, it is not used in the graph).