Unable to switch "Tax Information and Amount" and "Form Group". "Form Group" should come first:

Following below are my functions for Form Group and TIA, on the EDI Guide Form Group first before TIA but upon generation TIA always comes first.
public void FGS_FormGroupSummary(G_TFS g_tfs, string assignedId)
{
if (g_tfs.G_FGS == null)
{
g_tfs.G_FGS = new List<G_FGS>();
}
G_FGS formGroup = new G_FGS();
formGroup.S_FGS = new S_FGS();
formGroup.S_FGS.D_350_1 = assignedId;
g_tfs.G_FGS.Add(formGroup);
}
public void TIA_TaxInformationAndAmount2(G_TFS g_tfs, string taxInfoCode, string monetaryAmount, string quantity)
{
//Tax Information and Amount Segment
G_TIA tia = new G_TIA();
g_tfs.G_TIA = new List<G_TIA>();
tia.S_TIA_2 = new S_TIA_2();
tia.S_TIA_2.C_C037_2 = new C_C037_2();
tia.S_TIA_2.C_C001_2 = new C_C001_2();
tia.S_TIA_2.C_C037_2.D_817_1 = taxInfoCode; //"5003" = Total Due In Dollars
tia.S_TIA_2.D_782_2 = monetaryAmount;
tia.S_TIA_2.D_380_4 = quantity; //Quantity
tia.S_TIA_2.C_C001_2.D_355_1 = X12_ID_355.GA; //"GA" = Gallons
g_tfs.G_TIA.Add(tia);
}
Image attached below is the code that calls the functions above, you can see there that I call first the Form Group before TIA

Generation follows the sequence of the class definition. What transaction set and version is this ? If you need these two swapped then you need to swap them in the class definition.