What 4Tey said, and also:
Yes, the way you are doing things, you need to do it in reverse.
No, I finally tried it yesterday and it does not work. Ocurrs the same.If you have all groups expanded, works correctly.I do not think it’s from the Lua API for build tools.Something extra happens with the collapsed groups, and I think it has to do with the error fixed here.Expanded works, not expanded does not work.Has no sense.