Dual{::ForwardDiff...} type error when JuMP tries autodiff User-defined Function

Please read the documentation: Nonlinear Modeling · JuMP

You need to write generic code that is not restricted to Float64.