Chrome `pageCapture` unable to generate MHTML

I am trying to use Chrome's pageCapture API to download a whole page but before that, I need to modify the body contents. When I try to do that, i get the following error: Unchecked runtime.lastError: Failed to generate MHTML. Everything seems to work if I don't modify the inner HTML. This is the code:

// Works without this:
chrome.tabs.executeScript(activeTab.id, {
    code: 'document.body.innerHTML = <div>Something</div>'
});
// Wait a bit to update the content
setTimeout(() => {
    chrome.pageCapture.saveAsMHTML({ 
        tabId: activeTab.id 
    }, mhtmlData => {
        // Breaks here:
        console.log(mhtmlData);
    });
}, 200);

Any help on how I could work around this?