I’m glad you clarified, because there is no way that anyone would have derived the info in your second post from the info in your first post.
The bug I was thinking of (and mentioned earlier) doesn’t apply to this situation.
So I duplicated (mostly) your scenario and I do understand that things go “wrong” here.
I tend to think of it as a problem-between-keyboard-and-chair.
Should you really rename a directory when you have files open in that directory?
Some programs protect you nicely from this kind of thing (shown here for a folder, not a file):
f9d08ab7-7485-4048-896f-44d4466829d8-image.png
I suppose Notepad++ could do a better job of protecting you from the exact problem you noticed…
But I’d probably advise you to just NOT change the name of a containing folder when you have files open in that folder.