Nested vertical layout groups

I would like to nest vertical layout groups where all the groups’ height is expanded based on the content. The InnerGroups have a spacing of 10, and the OuterGroup have a spacing of 50. The Rows have the green color.

I uploaded the code here: https://github.com/kocsis1david/unity-layout-test

In the editor, without running, it looks good (first picture), but as soon as I run it, the layout collapses and the spacing between the Rows is zero.

There’s a warning that a child of a layout group shouldn’t have content size fitter component. It probably has to do something with the problem, but I don’t know how to achieve the same thing without it. If I change something in the layout while it is running, the layout is updated and fixed. It’s enough to change the spacing with one tenth of a pixel or something like that to cause a rebuild of the layout.