Yes, this is on the list to fix. To work around this, you can clean up the offset curve by doing something like this:
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var src_points = new Point3d[5];
src_points[0] = new Point3d(1, 1, 0);
src_points[1] = new Point3d(9, 1, 0);
src_points[2] = new Point3d(9, 9, 0);
src_points[3] = new Point3d(1, 9, 0);
src_points[4] = new Point3d(1, 1, 0);
var src_curve = new PolylineCurve(src_points);
doc.Objects.AddCurve(src_curve);
var offsets = src_curve.Offset(Plane.WorldXY, 1.0, doc.ModelAbsoluteTolerance, CurveOffsetCornerStyle.Sharp);
if (null == offsets || 0 == offsets.Length)
return Result.Failure;
for (var i = 0; i < offsets.Length; i++)
{
var curve = offsets[i];
if (null != curve)
{
if (curve.IsPolyline())
{
var polyline = new Polyline();
var dom = curve.Domain;
var t = dom.Min;
while (curve.GetNextDiscontinuity(Continuity.G1_continuous, t, dom.Max, out t))
polyline.Add(curve.PointAt(t));
if (curve.IsClosed)
{
var p0 = polyline[0];
var pn = polyline[polyline.Count - 1];
var v = pn - p0;
if (v.Length > Rhino.RhinoMath.SqrtEpsilon)
polyline.Add(p0);
}
if (curve.IsValid)
curve = new PolylineCurve(polyline);
}
doc.Objects.AddCurve(curve);
}
}
doc.Views.Redraw();
return Result.Success;
}