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: