Thanks for providing us details.
Well, for your case (as you are referencing to different sheets in the formula(s)) Shared Formula feature won't work. For your information, in MS Excel, if a formula refers to other worksheets, it will be copied to each cells and it is not applied/ added to shared formula(s) list. For confirmation, you may unzip the file (you may perform all the steps in MS Excel manually and save the file) and check the source .xml file for the sheet, you will see there is no shared formula with its attribute(s) described there. So, MS Excel actually copies the cell's formula from one cell to another cell but not set shared formulas.
For your situation, you should try to use Range.copy(sourceRange) accordingly, see the sample code segment for your reference and write your own code accordingly:
Workbook wb = new Workbook();
Worksheet worksheet = wb.Worksheets;
Cells cells = wb.Worksheets.Cells;
Cell cell2 = cells["AB1"];
cell2.Formula = "=INDEX(Product!E2:E104,MATCH(AT5,Product!B2:B104,0))";
Range range = cells.CreateRange("AB1");
Range range2 = cells.CreateRange("AB2:AB128");