Your code looks well written, well structured & well documented but to be truthful I don't really have the time to trace out all the logic.What I am thinking is you are implicitly creating a new path that contains an old DLL in it or more likely you are disconnecting a path that contains a required DLL. You know the missing DLL doesn't have to be a Kix DLL either. If you are using some kind of shared version of Windows you might be disconnecting a key system DLL.
About limits to the number of groups - it seems to me that if you have exceeded an kxrpc limit its impact should be more wide spread & effect more users than just you. It is my experience that kix is very linear in the way it approaches things - it doesn't tend to load & track complex lookup tables - it processes commands one at a time and carries over nothing to the next command. Kix is much like the old BASIC interpretative compiler or like the DOS command processor. It is very hard to overwhelm them because they take such a simple & straight forward approach to everything.
_________________________
Jack