As they have a CLI: yes, that should be possible.
From my (very superficial point of view) the main differences between ePub and PDF are
- PDF has standardized “bookmark” functionality (aka “annotation”), ePub doesn’t
- ePub does reflow naturally, PDF doesn’t (at least not really).
Perhaps because the ePub doesn’t lend itself easily to ToC generation? Did you read this explanation on Calibre and ToCs?