You can't have two Bobs at once, but that's not what you have here
If we look at spells such as reincarnate, raise dead, true resurrection, and resurrection, we see that they all mention the soul. However, the create undead spell does not impact the soul at all. To quote page 24 of the Dungeon Master's Guide "Bringing Back the Dead"
When a creature dies, its soul departs its body, leaves the Material Plane [...] Bringing someone back from the dead means retrieving the soul from that plane and returning it to its body. [...]
A soul can't be returned to life if it doesn't wish to be. [...]
So when Bob died, his soul had already left; if create undead is then cast on his corpse, his soul does not go into that undead. Thus, when a spell such as resurrection is cast, his soul returns and he can be revived (if he wants to be, that is). Bob only has one soul, but Bob's original body and soul are disconnected.
The trick here is that there aren't two Bobs. There is Bob's soul, which is now inside a new body (potentially a completely different one, if revived by reincarnate) and there is Bob's old body which turned into a Ghoul.