It's not a bug - the window width is not related to the viewport width. You meant the viewport width, but sized it to the window width which does not take in to account the scale. Instead, use the expression:
ViewportRight("Layer 0") - ViewportLeft("Layer 0")
Then the sprite perfectly sizes with the window, and if you update the 2nd example you'll see the values reported are different, even though it's working correctly.