I agree that a short test ride won't tell you everything you need to know about a bike. Fortunately, for one thing my LBSs now know me so I'm free to take it out on extended rides. Nothing crazy, but 20-30 minutes, enough to put it through its paces. And while yes you won't discover everything, what I find a test ride is invaluable for is finding out what you don't want or like in a bike. I've test ridden all of my current bikes and not a day goes by where I don't learn something new on each of them...mostly in good ways.
But what test riding did for me was to take quite a few makes and models off the table for consideration.
If you like (or really, really like) a bike on a test ride, chances are good that it will grow on you. Part of it is confirmation bias, sure. But if you're a seasoned rider, you know what ride characteristics you're looking for in a bike. But just as important...or maybe more importantly...you know what you don't like or want in one. When I was shopping for my gravel bike, I liked the Revolt ride the best and it's growing on me every day. But test riding also took the Grevil, Aspero, Checkpoint, Grail and Stigmata out of the running...whereas if I didn't ever ride those I would forever be wondering if I could have made a better choice with the others.