This is just a tolerance issue. If you tighten the dual feasibility tolerance it solves okay. GLPK would ideally warn that it hasn’t found the correct solution, but it worked as intended given the provided settings.
import GLPK
using JuMP
m = Model(GLPK.Optimizer)
set_optimizer_attribute(m, "tol_dj", 1e-9)
@variable(m, x, lower_bound=0)
@variable(m, y, lower_bound=0)
@variable(m, z, lower_bound=0)
@constraint(m, x + y - 5 >= -z)
@constraint(m, x + y - 5 <= z)
@objective(m, Min, 1.2*x + 1.1*y + 1e9 * z)
optimize!(m)
julia> value.([x,y,z])
3-element Vector{Float64}:
0.0
5.0
0.0
In general, you should not expect solvers to be bug-free. Even Gurobi and CPLEX from time-to-time will return suboptimal (or even infeasible) solutions as optimal. This can be due to a bug in the solver, or because of numerical issues.
You may want to try HiGHS out as an open-source MILP solver for your testing.