Failure to calculate the gradient of ODE with the RHS as an argument: "LoadError: TypeError: in TrackedReal, in V, expected V<:Real, got Type{Any}"

Are you using Julia v1.4?