Using this works on pdf files because the output stream waits until the end. However when using the MacroScreenViewHandler (for text/csv for example), you end up putting the servletResponse in the committed state by using response.getWriter() or by writing to the output stream.
response.getWriter is the default when using stock ofbiz. That gets called before any action takes place in evaluating the screen. There would need to be an override for that in determining "useOutputStreamNotWriter".
Once that's determined, the Tree Renderer tries to render it's template. That needs to be fixed to match the Screen and Form Renderers.
Then finally, there is an attempt to render the Screen Begin Macro.
I'm not sure how to best overcome this for use within the OFBiz project going forward. But checking for contentType "text/csv" before each of those issues fixes my local setup. Perhaps using a different View Handler when such modifications are needed is best (though Tree Widget Rendering differently than the others probably would need to be taken care of).