Like rendering a document containing a groovy macro from a groovy macro in another document.
The same instance of ScriptContext is used during the HTTP request (so share bindings between macros among other things) and right now AbstractJSR223ScriptMacro does not really take that into account. It should save a few plumbing stuff like the writer/reader and "context" binding and restore them after script execution in case it's a subscript.
Here is a simple script to reproduce the issue:
the second println ("after") ends up in the log because groovy cannot find the custom writer anymore and fallback on standard output.