Since you didn't post the actual code, I can only imagine where things go wrong.
What I can tell you from my own experience is that when using frames/textures, certain number values like scale, size, position can behave a bit odd, caused by various things like the UIScale itself etc.
e.g. instead of anchoring the frame at an offset of 130, the offset actually is 129.9999999...
or setting an object's scale to 1.2 actually scales to 1.199999...
Code:
/run local v=129.9999 print(v, string.format("%.0f",v), string.format("%d",v))
=>
129.9999 130 129