If a measure has a Ruby error in the measure.xml, this code adds a second root element: https://github.com/NREL/OpenStudio/blob/develop/src/utilities/bcl/BCLXML.cpp#L660
When running post-processing, REXML is used to load the measure.xml: https://github.com/NREL/OpenStudio-workflow-gem/blob/develop/lib/openstudio/workflow/util/post_process.rb#L196
This results in the error: #<RuntimeError: attempted adding second root element to document>\n:/ruby/2.5.0/rexml/document.rb:96