HTML5 creates random errors in in output.
FrameMaker Version: 17.0.4.628 on Win11.
I am trying my very best to publish a FM book to HTML5, but FrameMaker seems to generate random errors in the HTML5 publishing. Completely random chapters display differently in the menu.
This is what the menu is supposed to look like. A double entry with the name of the chapter first, and a dropdown with the chapter number.

But sometimes chapters misbehave like this. No dropdown with the chapter number and the entire page header displays in the top. The stylesheet is exactly the same across chapters.

I have had this error numerous times before, and I can't figure out what is happening. It can be fixed in the output using a text editor and some high magic, but I would absolutely prefer the publishing process to work out of the box. I have tried all sorts of tricks. Resaving the error prone documents, replacing them, moving them around, changing formats and so forth, but to little effect.
Anybody have a some suggestions?

