Adding block programmatically to InnerBlocks

I am building a tab-style block, where you can choose tab in a header and enter the content in the section. For section, I am using InnerBlocks where you can insert specific "Tab" blocks separately created. I set InnerBlocks property templateLock to ‘all’, so user cannot add tabs via usual interface. Instead, when "new tab" is clicked in header area, new Tab block should be programmatically inserted (via dispatch('core/editor').insertBlock()). This works only when Innerblocks template is not locked. Any solutions? Unlock then lock Innerblocks? How? Is there more elegant solution?