This isn't anything to do with bash.
It's standard Unix behaviour, these many decades past. It's standard behaviour of the kernel, and nothing to do with shells.
The important thing to remember is that files and directories don't have to have names. A file or directory remains in existence as long as it (a) has a non-zero link count, (b) is referenced by an open file descriptor, or (c) is the working directory of a process. (There are a couple of other conditions that can prevent a file or a directory from disappearing into nonexistence, but they aren't relevant to your question here.)
With files, you should be well used to the idea of creating an unnamed temporary file, that is automatically cleaned up when the last open file descriptor to it is closed, by opening a file and then unlinking it so that its link count drops to zero. (This is glossing over a lot of security-related details that aren't relevant to this question.)
You should also be well used to the idea that you can unlink a file that some process has an open file descriptor for, create a new file by the same name, and they will be two different files.
You've simply just done the same things with a directory. You emptied the directory and unlinked it, but it continued to exist until it was no longer referenced by an open file descriptor and was no longer the working directory of any processes. When you created a new directory by the same name that you had unlinked, you had two different directories.
Note that the SUS allows
rmdir ../a to fail if the directory named is the current directory of any process. (This isn't to give POSIX APIs layered on top of Windows NT a loophole, as some might think. QNX fails the call in this case, too, for example.) You're obviously running an operating system that (in the absence of considerations like root directories and mount points, which your question doesn't involve) chooses the other allowed alternative, which is to unlink the directory, remove the
.. entries, and prohibit making new entries.
- "rmdir". The Open Group Base Specifications. IEEE Std 1003.1. Issue 7. 2013.
- "rmdir". QNX Neutrino Realtime Operating System Library Reference. QNX Developer Support.