Type unstable function because same variable name used twice

In my first (non-working) example, I actually had a huge performance impact (factor 100 or something) and it was resolved by deleting the unnecessary line.
I never used that initial variable, it was just there.

Is that an issue or expected?
Otherwise I try further digging to come up with a real MWE.