Aaron Shephard is close to giving up in Kindle. [You may need to search as I could not find a post-specific link.] He’s found evidence that Amazon might, and probably will, destroy your formatting well after it has been published.
As you can read below about the new KFX format, Amazon simply does that to your book. It’s out of our control and we have been given no tools to produce KFX files.
I suspected all of this, but I’m not surprised. I’ve been ready to bail for quite a while. I mean, many of my books are about formatting, and Kindle really doesn’t allow that. Kindle produces bottom-end ebooks. If formatting is important to you (and it should be), make sure you give the other distributors of ePUBs a chance. Make sure you recommend the better options to your readers who have choices.
Another possibility: Kindle textbooks
You can produce a fixed layout version of your book to maintain the formatting. It starts with your print-ready PDF. Because there is no live type, Amazon can probably not mess with it too bad. But don’t count on it. The 500# gorilla could well stomp on this type of book also.