Firstly, I would rename the second variable, this will help you debug this problem if you can distinguish it. In addition, I myself came across this type of problem, and it always turns out that another operation changed the value. Your variable is a class, and, like operations with it, there is always a chance that somewhere it will change something. I would check all the places where this variable will be affected (passed), and see if there is something that you missed.
Good luck.
source share