I just spotted something you wrote:
It’s not possible to add something to the Header from the Body. If you put any code in the body, then the highest place you will even get that code is just under the Breadcrumbs. The same goes for the Footer.
If the Documentation is telling you to do it this way, I honestly can’t think of a reason why - Unless you legitimately wanted to add a second Menu to your pages…