Solution to this problem is quite simple. Just wait until the HTML is parsed, before calling customElements.register. The scheme I normally use when the HTML children have to be processed in connectedCallback:
class MyComponent extends HTMLElement{ static { globalThis.addEventListener('load', ()=>{customElements.define('my-component', MyComponent)}); } }