No, that doesn't cause any problems at all.
Within the scope of the new variable, the compiler uses that value, when it goes out of scope, it uses the global value.
Not really recommended, because as you've seen it can cause confusion for the reader, but not the compiler.