When there is a layout tag with more than one child, the layout tag is converted to a tag and it works as expected. When you have a layout tag with a single child, dali promotes the child one level up and the layout tag is removed completely. Layout happens in "eval order" so in this case, the two stack tags are laid out first, the IDs get lost because of the promotion, and then connect is unable to find them and throws an exception.
Example: