The setting Admin -> Appearance -> Additional HTML -> Before BODY is closed is described as:
Content here will be added in to every page right before the body tag is closed.
However, this content is currently added to the page in $OUTPUT->standard_footer_html(), which is only included on pages where $hasfooter is true.
I think it should be moved into $OUTPUT->standard_end_of_body_html() which really is added to every page.
And I have coded a patch that makes that change.
So, if you disagree, scream now in MDL-43581. Thanks.