WebServiceAfterOperationRule does not update return variable

We have referred this SailPoint IDN document IdentityNow Rule Guide - Web Services After Operation Rule - Compass

Our code works fine and we can check that through logs. However, whenever we identify duplicate record fetched through existing webservice response and modify final response variable, it does not return the same as final data through aggregation.
Actually, nothing changes on aggregation data set and everything is returned as is. We are wondering if the response variable that we are trying to modify and return, is it the actual one we shall modify. This document does not provide any more details on that part. We have tried to modify and return these variables in code as per documentation:

o updatedAccountOrGroupList – to modify and set updated list with key as “data”
o processedResponseObject – to modify existing input variable and return updated list
o updatedMapInfo – based on example provided on this document.

None of this has worked so far. We have already discussed with SailPoint DA team and their inputs confirm the same code shall work. It is still not working as expected. If you have any insight or quick answer to this, please do let us know.

Current code is :

Map updatedAccountOrGroupList = new HashMap();
List updatedList = new ArrayList();
log.error("current HR account records number, including duplicate data: " + processedResponseObject.size());

                  //Iterating through processedResponseObject to identify duplicate records based on termType value

                    for(int i = 0; i < processedResponseObject.size();i++) {
					
						Map currentRecord = (Map) processedResponseObject.get(i);
						
						log.error("Current record number :: " + i + " is with employeeNumber :: " + currentRecord.get("employeeNumber") + ", and termType as :: "+ currentRecord.get("termType"));
						
						String termType = (String)currentRecord.get("termType");
						
						if((termType == null) || (termType != null && !termType.equalsIgnoreCase("T"))) {        	
							updatedList.add(currentRecord);
							
							log.error("updated record number :: " + i + " is with employeeNumber :: " + currentRecord.get("employeeNumber") + ", and termType as :: "+ currentRecord.get("termType"));        	
						}
                        }
                        log.error("HR account records number after removing duplicate data: " + updatedList.size());
                        updatedAccountOrGroupList.put("data", updatedList);
						log.error("HR account records number after removing duplicate data: " + updatedAccountOrGroupList.size());

        return updatedAccountOrGroupList;