You are removing an element from the group which is involved in a sketch or family constraint with another element of the same group. Either remove the constraint or cancel the removal of this element from the group. 
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Syntax
| C# | 
|---|
|  | 
| Visual Basic | 
|---|
|  | 
| Visual C++ | 
|---|
|  |