Links are overlapping nodes in LayeredDiagraph Layout

I have a diagram with nested groups as shown in the image.

Diagram has LayeredDiagraphLayout. The Models group also has LayeredDiagraphLayout. The teta has GridLayout. The linkTemplate has AvoidNodes` routing. Still the links are overlapping the nodes.

Can you point out, what might be the cause for it?