The OSM XML generated by Overpass appears to be valid, but based on tests, osm2cdr seems to require a global <bounds> element in the file. When a global bounding box is defined in the Overpass query using [bbox:{{bbox}}], Overpass includes this <bounds> element in the XML output, and the resulting .osm file is accepted by osm2cdr.
For those using this software I came across a couple of another reason for rejection after I loaded the data into JOSM to manipulate it before saving it back to the osm file & converting to svg - It can’t cope with negative ids which JOSM assigns to newly created objects. After I removed the negative signs in a text editor, osm-cdr accepted the data.