I think something similar happens in the Heinlein story "All You Zombies". And he did another brilliant time travel paradox story called "By His Bootstraps". These stories were written back in the 1940s and 1950s, before he became weird (and at times objectionable).
no subject