Hm… I also did this, until something broke and Patrick said it was working as intended
If I’m not mistaken, the non-global variable has priority over the global one when under the same scope, and this made the logic I saw different from what I predicted. Sorry I don’t recall the situation in specific, but I opened a bug report, which was probably moved to the How To category for not being a bug.
Since then, I always suffix global variables with _g