"The object expired during a solution" when calling the GetObject()

The message “The … object expired during a solution.” when calling the Rhino.Input.RhinoGet.GetOneObject() method inside the component.

Same with Rhino.Input.Custom.GetOneObject

It’s possible that I’m calling Rhino commands from Grasshopper incorrectly.

Please tell me what could be the problem? I need the command from Grasshopper to give the user the opportunity to select a polyline, specify a point on it, and then the polyline is replaced with a new one with a new point. And the code works, but this error pops up on the call to Rhino.Input.RhinoGet.GetOneObject()

Снимок экрана 2023-05-12 173317