This issue is not reproducible in the current version of Survey123. If experiencing the behavior described in this defect, reach out to Esri Technical Support for further investigation.
According to the following documentation: https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformrepeats.htm#ESRI_SECTION1_045B883052D844E89F8EEFF8C2EA638A, when used in the Survey123 field app, sum and count can be placed inside or outside of the repeat. If sum and count are to be used in the Survey123 web app, they must be placed outside of the repeat. A sum or count value from outside the repeat can be referenced in a calculation inside the repeat.