Duplicate results are returned in pop-ups when iterating over array elements and using the when() function to evaluate different expressions and the expressions are using functions.
This issue is not reproducible in ArcGIS Map Viewer. If the issue occurs, please contact Esri Support Services as additional information is required for further investigation.