That’s very odd. Does your Group template have its own Group.layout? If so, what is it? Also, which version of GoJS are you using?
It’s normally the case that hiding or showing a Node or a Link will cause the responsible Layout to be invalidated, causing a layout to happen again soon. That’s certainly the case when expanding a subgraph – the whole subgraph becomes visible, so the whole subgraph is laid out again. You can prevent that by either setting Layout.isOngoing to false or by turning off the relevant flags on Part.layoutConditions on all of your Nodes and Links.
For more details, please read: http://gojs.net/latest/intro/layouts.html