Also sometimes altium gets a little stupid about names. A lot of functionality relies on the names of things, including the way it resolves references to objects, and there are certain patterns of intermediate names it creates to keep track of connectivity (and other references-by-name necessary to achieve the 'A' in EDA) while compiling the project. Occasionally a user's naming scheme isn't digestible to the compiler, because it resembles one of those internal patterns and it gets confused. The whole thing is rife with problems like this, where when you really try to automate things using the built in tools there are tons of traps, limitations, and just plain bugs all over the place because of how fragile it is.
So you might just need to fiddle with how you've named things and the annotation settings and see if it starts working.