Hey @bojidar,
I would suggest that you write a mail about this, so that I can forward it. All I can tell you is that for variadic ports all bets are off. I really ran into this issue when I had to handle variadic ports for graph descriptions.
When you instantiate a node with variadic ports, it usually has some default children. I have never tried what happens when you try to remove all ports (graph description can do this, but they then do not test if the system does not regenerate them). There is also no guarantee that the 1st variadic port has the ID _0. It is just a convention, which is for example directly borken by the Standard Renderer Material node, as it gives its first BSDF layer port the ID 1, and the 2nd manually created layer then the ID _0 (because of course it does):
76bb0bfe-ff1f-4530-a55c-059bc195e46b-image.png
1aa63fb8-e9dc-4e83-80b6-7ffa782752af-image.png
You really have to write a mail here, because this is so deep in the Nodes API internals, it requires a true specialist to answer it.
Cheers,
Ferdinand