Interesting. Actually, I wish I had known about that Prince XML software sooner. That's apparently what is being used for the "Custom PDF" option on feedbooks, which I've just now tried, and am getting pretty good results.
My main complaint is that the one I tried did not have "smart quotes", but straight ones, but I take it that's a problem with the Gutenberg source.
Here we have a working model of almost precisely what we're after, so it's worth poking into a bit... too bad Prince XML isn't open source.
Funny thing is that I could swear the chapter titles are generated with LaTeX's fncychap package... maybe someone has ported it...