Not sure why there is this inconsistancy with the newer achievements, in the past it all worked like votan said. You'd access the "General" achievements by passing "nil" as the second parameter for
GetAchievementId and the rest of the achievements were in subcategory 1 to x. All of this comes directly from the client so I guess ZOS decided to mix things up for a change.
None of this would really matter because, per your posted snippet, the numAchievements return value (the third) from
GetAchievementCategoryInfo is 0. So you don't end up with duplicate "General" entries as long as you check that I guess.
Edit: Oh wait, so I guess the misunderstanding is with using nil for
GetAchievementSubCategoryInfo to get the "General" achievements. Which isn't the case, you pass "nil" as
subcategory to
GetAchievementId. See the vanilla code for a better understanding on how it all works:
https://github.com/esoui/esoui/blob/...ents.lua#L1802