I once wrestled with a similar phantom variable problem during a JavaScript project. A callback function, acting as my
Slice Master, kept referencing a stale loop variable, leading to unexpected data mutations. It was a head-scratcher until I realized the closure was capturing the variable by reference, not by value.