A nonnegative decision variable having an "optimal" value of -1e-10 is not unusual, and should not be a problem, whether the variable is continuous, general integer, or binary (yes, binary variables are not necessarily exactly zero or one). So your procedure to adjust the returned value to exactly zero should be fine.
However, having non-zero input data spanning a wade range of magnitudes, or not being within a small number of orders of magnitude of one, does have the potential to cause numerical difficulties in the solver, or to make the solver's assessment of the problem being (primal) infeasible or unbounded, be unreliable. When using Gurobi, the solver can be instructed to be more numerically robust, at the expense of computation speed, by setting the NumericFocus parameter to a value such as 2, or for the most extreme emphasis on numerical robustness, 3.
When there is very large or small magnitude input data, it is better to try to re-scale the problem (by changing units) if possible, or chopping off "nuisance" coefficients which should be exactly zero, but are not due to the procedure used to generate the input data. But if this is not possible, consider setting the NumericFocus parameter to a high value if your non-zero input data does span a wide range of orders of magnitude.
Gurobi staff member Silke Horn wrote in answer to a support question:
In general, we can say that the higher you set NumericFocus the more
careful Gurobi tries to be with numerics in the simplex algorithms,
presolve, barrier and crossover. We cannot give you all the details,
but here are some of the things that the NumericFocus parameter does:
It tightens tolerances such as the Markowitz tolerance, bounds on
redundant constraint detection or the step length for barrier. It also
makes Gurobi use less aggressive cuts. The higher the setting, the
tighter the tolerances. With NumericFocus=3, it also switches to quad
Here is a Gurobi forum answer by a Gurobi staff member to a related question..
The NumericFocus parameter automatically controls the quad precision
computation, the Markowitz Tolerance, and a few others. Since
NumericFocus automatically decides whether to use quad precision, it
is possible that setting the value to 2 or 1 will also enable it,
where a higher value favors the enabling more. If you want to
explicitly enable Quad Precision, you can set the Quad parameter.