Hello Ttogether,
when you make a Window selection with SelectEvents (API), it isn't possible to select when you edit a sketch which isn't the last one. Allow to select also in this 'older' sketches. A more detailed description you can find under https://forums.autodesk.com/t5/inventor-customization/selectionevent-in-sketch-environment/m-p/78637....
Best Regards
Wolfgang