Is this happening for all the layouts like which are directly included in sections?
I am aware of a scenario where this happens. If you include dynamic layout inside a layout group, you can observe this because the direct child of layout group should not be flex(optimized code) which is expected.
We have a logic behind to check that in pzpega_ud_simplelayout. js file and set the layout mode to legacy code.