Weird UI positioning bug

So I recently encountered a weird bug with positioning UI objects that hasn’t occured anywhere else. In my project, I had a script that repositioned a UI object during runtime whenever a button is clicked. This worked properly the FIRST time, but for some reason after that the repositioning stops working VISUALLY, even though its actual position data has been correctly set! (e.g. UI Object A is moved to UI Object B’s x position. Inspector shows that it has successfully been moved, but in both scene and game views UI Object A hasn’t moved at all)

I have attached a screenshot of the problem, where you can see the panel selected in the Scene view but it’s actual visual position hasn’t been updated:

Has anyone else encountered this problem?

OK, I’ve found a workaround solution to this. Basically what happens is that everytime before i can click a button to reposition the panel as seen above, I have to click once to deactivate the panel. The bug here seems to occur if I do the repositioning BEFORE I reactivate it. Once I switched that around to do the repositioning after activating the object, it worked perfectly fine.