casualtiesReport() is returning HTML strings (although the way the strings are broken up, it looks like JS DOM was intended at some point.) However, the first two times it's used it's used with App.UI.DOM.appendNewElement which does not parse HTML strings.
edit2: The for loop on line 1201 is wrong as well. It seems to assume type is a string, but App.SecExp.unit.list() returns a map, not an array. I think App.SecExp.unit.list().keys() is intended.
edit3: not sure what is going on with the loop in 1244, but the typing for unit is not right. I think it works correctly, though.
This works:
if (inRebellion) { for (const unit of App.SecExp.unit.list().keys()) { if (unit === "bots") { continue; } App.UI.DOM.appendNewElement("p", node, rebellingUnitsFate(unit, averageLosses)); } } else {