I moved a whole bunch of custom configuration code out of the “custom
library code” (and set it to "manage the library for me") and into the
“configure tracker using custom code” section, and as if by magic the
global variables and Set Attributes parts of the tool are working again.
So it must have been something in that code which was breaking it.