InnerBlocks adds any block and saves, but the editor doesn’t show child blocks on reload

Turns out the parent block was locking the template. I added some code to lock InnerBlocks only when we a new child block is added.

for (let i = 1; i <= parseInt(numChildren); i++) {
        defaultChildren.push(
                ["accordion/child",
                    {
                        className: 'accordion-' + i
                    }, [["core/paragraph",{content:'Accordion ' + i,}]]
                ]
        );
    }
    
    const onChangeNumChildren = (newNumChildren) => {
        setAttributes({ numChildren: newNumChildren });
    };
    
    let forceTemplateLock = false;
    let childrenInThisAccordion = jQuery('.wp-block-accordion.is-selected .accordion-child').length;

    if (childrenInThisAccordion > 0 && childrenInThisAccordion != numChildren){
        forceTemplateLock = true;
    }

    return (
        ...
            createElement('div', { ...blockProps },
                createElement(InnerBlocks, {
                    template: defaultChildren,
                    defaultBlock: defaultChildren,
                    templateLock: forceTemplateLock ? "all" : false
                }),
            

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)