A function can only be indexed if it can be converted to a program (i.e. if it actually is a program from the pike programmer point of view).
That error message doesn't intentionally imply it can be indexed, though. It prints the indexing value in all cases just to be more informational; it's often not obvious from neither the backtrace nor the source.