In order to write the bottom matter to the HTML file so that it contains valid HTML, you must open the HTML destination one more time. NO_TOP_MATTER ensures that the top matter is not placed in the file again. ANCHOR= provides a new base name for the anchors in the bottom matter.
ods html file=reports(no_top_matter) anchor='end';