just when i posted the question is see my problem.
int CScriptBuilder::AddSectionFromMemory(const char *scriptCode, const char *sectionName)
AddSectionFromMemory takes 2 arguments. I forgot the 2nd one to pass the included script name. So the first one gets added and the second one gets ignored because of the same (null/empty) section name.