Here are three related bug reports ...
https://github.com/futurepress/epub.js/issues/1084
https://github.com/futurepress/epub.js/issues/1107
https://github.com/futurepress/epub.js/issues/469
It seems to confuse href from nav with an opf relative href. Since the ncx and the opf generally sit together this works but if the nav is in a Text folder it will not.
The 1084 issue has a suggested fix that was never incorporated. I will look into adding it.