HiGHS does not return duals for MIPs.
You should not query dual(con) without first checking dual_status(model) to see if a dual solution is available.
If a dual solution is not available, for example, because dual_status(model) == NO_SOLUTION, the querying dual(con) is undefined behavior that depends on the solver. It might error, or return a placeholder value like 0.0.