Guilin Sun
Ansys Employee

I guess it is not because of the splicing.Instead, it is due to the mesh which might not be uniform. The internal calculation has considered the non-uniform mesh. But your script does not since you simply sum them up. I would suggest to use integrate:

https://optics.ansys.com/hc/en-us/articles/360034405814-integrate-Script-command