We have mapping in place whcih looks at the value of receiver and if it does not match with QA, by default it assignment the dev system as receive
>>> Can you share the UDF?
Are you reading the system name(System.getProperty("SAPSYSTEMNAME")) to determine the environment of the XI system??
Make sure that updated the logical system names in SLD..