Originally Posted by kovidgoyal
calibre follows links in depth first order if I remember correctly. If your files contain interlinks that can mess up the ordering. I would suggest using an EPUB editor to fix the ordering post conversion, or use the command line ebook-convert tool with the --breadth-first option to convert the html.
It's a reference manual of sorts so there are a lot of interlinks.
I think I found a solution however.
I extracted the epub with 7zip and found the toc.ncx which is a plain text XML file, in here the chapters appear in the same incorrect order they do when viewing, as long as I can modify this and zip it back up I should be good to go.