Understanding GoToolDragging exception stack trace

We are using 4.2.0.2 GoWin. I am taking over maintenance of a large GoDiagram based system, please bear with my rusty Go-fu.

I need help understanding the following error that happens intermittently in production code. The code uses custom dragging tool deriving from GoToolDragging. I have underlined our calls to separate them from Go code.
Could you help me understand what does this mean and what to start checking. It appears like a layer is null that is required by the comparator but I thought I’d ask for your opinion and comments. Thanks.

System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object.

at Northwoods.Go.GoLayerCollection.IndexOf(GoLayer layer)

at Northwoods.Go.GoLayerCollection.ZOrderComparer.Compare(GoObject a, GoObject b)

at System.Collections.Generic.ArraySortHelper`1.SwapIfGreaterWithItems(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)

at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)

at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)

--- End of inner exception stack trace ---

at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)

at System.Array.Sort[t](T[] array, Int32 index, Int32 length, IComparer`1 comparer)

at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)

at Northwoods.Go.GoCollection.Sort(IComparer`1 comp)

at Northwoods.Go.GoLayerCollection.SortByZOrder(GoCollection c)

at Northwoods.Go.GoToolDragging.CreateDragSelection()

at Northwoods.Go.GoToolDragging.MakeDragSelection()

at Northwoods.Go.GoToolDragging.DoDragging(GoInputState evttype)

at Northwoods.Go.GoToolDragging.DoMouseMove()

at ElectricalControl.Schematic.CustomDragging.DoMouseMove() (GoToolDragging - based)

at Northwoods.Go.GoView.DoMouseMove()

at Northwoods.Go.GoView.OnMouseMove(MouseEventArgs evt)

at ElectricalControl.Schematic.SchematicView.OnMouseMove(MouseEventArgs evt) (GoView-based)

at System.Windows.Forms.Control.WmMouseMove(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I’d have to see what is happening in your overrides.