This page https://quarto.org/docs/output-formats/html-basics.html#includes is out of date as only include-in-header, include-before-body, include-after-body should be used, with the text: sub field if needed
PDF doc is correct https://quarto.org/docs/output-formats/pdf-basics.html#latex-includes
@cwickham assigning you too in case you want to tackle this. Otherwise I'll do it after bug fixing