Found it!
need to consider the elevation of the view
var elevation = uidoc.ActiveView.GenLevel.Elevation;
XYZ min = new XYZ(-w, minZ - offset - elevation, -offset);
XYZ max = new XYZ(w, maxZ + offset - elevation, 0);
but without the example, provided in 2012, I would not have been able to do it