I created a complex style for a layer using rule based styling. In the original project, the layer is presented in the layers panel the same way it is displayed in the layer properties, that means grouped into several main categories with sublevels, as shown here:
The advantage is, that I can turn of entire layers of information, if needed. However upon loading the style from a QML into a different project, all symbols are now on on level and can only be disabled one by one, as shown below:
In the QML-file the structure looks fine to me:
<rules key="{63dbbb5f-7045-4662-840c-38d549e97198}">
<rule symbol="0" key="{e678f11f-2cbe-4513-99fe-31c8ecdc4580}"/>
<rule label="Urgency Classification" key="{97cbfa40-fc6d-4947-b8e0-e0249feef0ef}">
<rule label="UC NULL" symbol="1" filter=" "Priorisierung" IS NULL OR "Priorisierung" = -1" key="{4aa49c55-6372-493c-a878-bfa6d9556c66}"/>
<rule label="UC-" symbol="2" filter=" "Priorisierung" = 0" key="{dae3145c-3045-4eb3-91bf-49c024514dbc}"/>
<rule label="UC1" symbol="3" filter=" "Priorisierung" = 1" key="{46e4ced4-89c7-4fce-a1b2-797a89ce52fa}"/>
<rule label="UC2" symbol="4" filter=" "Priorisierung" = 2" key="{52485093-9bf9-401c-8a7a-4c1cce6448fe}"/>
<rule label="UC3" symbol="5" filter=" "Priorisierung" = 3" key="{3d9ca004-ea0a-477a-8d7f-49e098253ee8}"/>
</rule>
<rule label="Condition Classification" key="{f3c22636-1bd6-4d66-ae95-00d80bea51bc}">
<rule label="CC NULL" filter=" "Zustand" IS NULL" key="{71db925f-5db2-465e-b7f8-fa9e1072dce6}"/>
<rule label="CC0" symbol="6" filter=""Zustand" = 0" key="{d6942724-2992-4afd-9c7d-e002e2843a6e}"/>
<rule label="CC1" symbol="7" filter=""Zustand" = 1" key="{4b19a241-8bbb-48b2-9d2b-0da99304b858}"/>
<rule label="CC2" symbol="8" filter=""Zustand" = 2" key="{5c267bc0-1137-4c0c-96fd-ab50d744e39b}"/>
<rule label="CC3" symbol="9" filter=""Zustand" = 3" key="{ec10e658-949e-44da-909a-a9444628932a}"/>
<rule label="CC4" symbol="10" filter=""Zustand" = 4" key="{26d7fb9c-464d-4e81-9312-65b6be0105c0}"/>
</rule>
This appears to be just a bug, but I don't find any way, to turn back to the grouped view, without redesigning the entire style.
Edit: I am using QGIS Version 3.16.3.