Trying to Find a (Non-TG) Science Fiction Story

I'm trying to recall where I read an SF plot. The gimmick was that humans have a soul, or animating spirit, enter them at birth and exit at death. But since there were only a finite number of souls and they recycled after each use, Earth's human population had reached the point where there weren't enough of them to go around and many children were being born in a vegetative state: nothing physically wrong with them but unable to interact with the world. (Robert J. Sawyer, maybe?) Can't remember what the "solution" was; I don't think it was genocide or universal contraception.

Seems tempting to suggest a comparable situation, in which humans at birth grab onto a kindred soul from those surrounding them. But with souls now in short supply, bodies have to grab one from nearby before someone beats them to it, even if it isn't a good fit. As a consequence, the world sees a lot more TG people, and also an increase in extreme autism cases.

Eric