There are already machines (called autorefractors) that can try to calculate your prescription. They operate on more complex principles than flipping lenses back and forth. They can provide a good starting point, but sometimes they aren't accurate.
A good optometrist can do a lot more than just give you your prescription, though. They should be checking your eyes for signs of disease, and treating things that they find. Seeing an optometrist for a checkup is preventative medicine, like regularly seeing a primary care physician or a dentist.
They still need an optometrist on-site, and they have a bunch of sample frames you can try on and order right there, and/or have sets you like sent directly to you to try on later so your partner can weigh in / you can take you time, etc.
Glasses take about a week once ordered and are typically priced such that they're fully covered by insurance. I felt like they were comparable to Warby Parker quality as well.
I was a guinea pig to give them feedback and it was VERY slick - I feel like it took only a few minutes. Way better than the A/B optometrist process and opaque and expensive frame / coatings upsell.
Anyways, apologies for sounding like infomercial - it's just they do a really good job with an upgrade on the kind of device you're talking about so I figured I'd share exactly how it works.
I feel like their main limitation is finding optometrists in new cities who are willing to "try something new" to run diagnosis events - who unsurprisingly tend to be younger doctors less invested in the legacy diagnosis model.
I've never been to optometry school, but 10/10 times I've gone to get a new prescription, the prescription process has been extremely algorithmic, to the point where I wonder if cartel-esque forces are preventing automated optometry machines.