Yes. Basically, an extension module has to be precompiled before being used. So if you use it in the same module (or subproject, whatever the name we use) it is defined in, it will fail. What Peter says is basically that if you use it in tests, then you have de facto two distinct compilation phases (one for main classes, one for tests) so it works.
An option would be to create a different GroovyCompile task for your extension module, in a distinct source tree. The other would be to have a distinct subproject.