Button onClick not executing certain lines of code with touch input

Hi,
I am facing a very weird issue for a week now, someone please help.

I am making an AR puzzle app in which i have a button on a canvas which is supposed to destroy a gameobject as well as SetActive another gameobject. In the editor, with mouse input everything is working perfectly, but when i built and run it in android, i can see the button is getting highlighted when I touch it, but the object is not getting destroyed while the other gameobject is getting SetActive. I have no idea why its not executing that particular line of code.

// share your code as text here, please