Xpath isn't my strong suit, but it looks like it would have worked if you hadn't touched anything in the 'Table of Contents' section.
Basically this:
Code:
//h:p[re:test(@class, "chapter", "i")]
Is probably screwing up the default TOC xpath in the structure detection section, which should detect your chapter headings by default.
If you get the structure detection/TOC settings right Calibre will generate an NCX for you.