I have been working on this html file and found some empty <span></span> tags which I removed. I did further editing -- nothing much -- added some <br /> tags to show scene changes and a few other things that I cannot remember now.
By the way, my own headings are just <h4>Heading</h4> but Calibre adds the extra code during conversion.
I made a new epub file and checked it in the reader -- hey presto it's working properly now. Whatever I did solved the issue but I'm still not sure what is was.