Is this "The Immortals" (1960) by David Duncan...?
Dr. Clarence Peccary has invented a drug called 'Y Hormone' that can slow one's ageing indefinitely.
The bottle contained a sample of the Y Hormone which Dr. Peccary had spent many years developing. Its principal ingredient was a glandular extract from insects, an organic compound that controlled the insects' aging process. If administered artificially, it could keep insects in the larval stage almost indefinitely.
Dr. Peccary's great contribution had been to synthesize this extract—which affected only insects—with protein elements that could be assimilated by mammals and humans. It had required years of experimentation, but the result was his Y Hormone—Y for Youth.
His colleague, Roger Staghorn, has invented a computer called 'Humanac' that can predict the future using calculations based on data fed into it and the laws of probability.
Staghorn was constantly having trouble explaining to people that Humanac was not a time machine that could look into the past or future. Its pictures of past events were based upon information already present in its memory cells. Its pictures of future events were predictions calculated according to the laws of probability. But because Humanac, unlike a human, never forgot any of the million and one variables impinging upon any human situation, its predictions were startlingly accurate.
Peccary wants to know how widespread use of the Y Hormone will impact society, so he brings a sample of the Y Hormone to Staghorn to see what Humanac makes of it. Wearing VR-style headsets, they're shown that in a future society where people don't age, but can still die from injury, they'll become increasingly risk-averse to the point of trying to eliminate all possible hazards and creating a dystopia in the process.
"Because he'd had it pounded into him that if the Atavars got him he'd die. He will, too, eventually. Like any other mortal. But in the meanwhile—" He broke off and turned on Peccary savagely. "You see, there's one thing you didn't consider at all! The Y Hormone stops aging and keeps people healthy, but it can't protect them from accidents. The immortals can still die if they get hit by a train or fall overboard in the middle of the ocean. A mortal can accept the possibility of accidental death because he knows he's going to die anyway sooner or later, but can't you see the psychological shock to the immortals when one of them dies? A man who had the potential of living forever, suddenly wiped out! It's like the end of the world. And so they started eliminating hazards. Automobiles went first. Then planes and trains. They weren't needed anyway, because people stopped traveling. To travel is to court accident. But one precaution breeds another, and before long people were avoiding all dangerous occupations. With immortality at stake, even the smallest risk was too much. Planing mills, machine shops, mines, smelters—bah! Name me an occupation that doesn't occasionally entail some hazard. Even motherhood!"
"But I anticipated the need for birth control! I had the plans all set up."
"There was birth control all right, but not the way you planned it. Ten years after your hormone went on the market the world had an extra five billion people. For a few years they produced a surge of energy until the older immortals started eliminating the hazards. After that, starvation set in. Three-fourths of the population died. Your hormone can't keep people from starving, either, and it was a shock from which those who survived never recovered. Every new mouth to feed was a threat. Childbirth practically stopped. But that left the remaining immortals in a very soft position. For years now they've been existing on the leftovers from civilization, finding shelter in the old houses, ransacking the attics and closets of the dead for scraps of clothing, daring to plant a few crops in areas where they'll grow with little care. And after that—boredom."
He thrust an accusing finger at Peccary. "And you dared to use the slogan, 'Time to achieve perfection!' I tell you, Dr. Peccary, the source of man's courage and energy is the knowledge of death! Man was meant to be mortal. We strive because we know the time is short. We climb mountains, make love, descend to the depths of the sea and reach for the stars because the certainty of death urges us on. It's the only certainty the world had—and you would destroy it!"
The full story is available to read at Project Gutenberg.