Is this version 19 by any chance?
If so then GLOB_CONTEXT can no longer be relied upon.
It should still work with the latest hotfix for 19 with just a warning error message when scripting the object.
But maybe it isn't work properly in 19 now.
It definitely will not work with version 20 next year.
GLOB_CONTEXT has gone and has been replaced with other commands (that aren't as good in my opinion) - which you can get information on here ...