Another update: From a hunch by a fellow forum member, I tried renaming the sub so that it didn't start with "set". Then I could compile it obscured, right away.
So perhaps the error message could be adjusted to clarify the forbidden prefix I used? And also, do we have a forum page that lists these unexpected features of B4X? This one was new to me, but I've heard something about subs should (or should not, can't remember) contain an underscore for something to work. Perhaps there are more? Might be good to list them all..?