IDA names unrelated values whithin one function

Tried to name a -1 as INVALID_HANDLE_VALUE. The value got named in the whole function body despite I only selected one location and it doesn’t make sense in other locations. I am a recent user of IDA, but I guess this is a bug. IDA Free 9.3.260213

ida_OeRaGStj0l