I have tested it with /framestack and it happens in the portrait side (the extended invisible zone) like you say, although the code is still incorrect because the castbar ends up in a completely different position when I alter its scale (with scale 2 it ends up in the center of the screen lol). If the code were correct the castbar would always end up in the same position.
I have also tried dividing instead of multiplying without success.