ExecuteAction doesn't work very well. It has a lot of bugs.
I find it easier to just add the xml directly to the data source.
Setup a DOM with the data from sampledata.xml to use as your pure source of xml like this: (you will need to modify the namespace line for your form)
(in C#)
SampleDOM = (IXMLDOMDocument2)thisXDocument.CreateDOM();
SampleDOM.async = false;SampleDOM.validateOnParse = false;
SampleDOM.load("sampledata.xml");
SampleDOM.setProperty("SelectionNamespaces","xmlns:my=\http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-27T21-01-33\");
Then append the xml your optional section is linked to (I strongly suggest putting your optional section group in a wrapper group with the optional section as the only child):
IXMLDOMNode parent = thisXDocument.DOM.selectSingleNode("my:root/my:WrapperGroup");
IXMLDOMNode OptSection = SampleDOM.selectSingleNode("my:root/my:WrapperGroup/my:OptSec").cloneNode(true);
parent.appendChild(OptSection);
The section attached to the group my:OptSec should then appear in the view. This works for repeating tables, etc.