What we want (this legend was created manually, converted to graphic):

What it now looks like (automatically created according to style template):

We cannot find an option to remove the space between different layers within the same group. The spacing option for "Items" changes also the spacing between the groups. The spacing option for "Group layers and items below" changes the space between the group name and the layer below it. We need a spacing option for "Group layer and items above" or simply an option to define the spacing between group layers without affecting the space between layers.