I had two Samsung flagship phones, one (S20FE) had an optical fingerprint reader and the other (S22) had an ultrasonic one. Both of them somewhat regularly failed to read my finger, were slower than a fingerprint reader on the power button and are more expensive/complex to build. They won’t work with cheap 3rd party screen replacements and some screen protectors as well.
Meanwhile my $90 Android phone has a fingerprint reader on the power button. It never fails and I never have to perfectly place my finger on the sensor area to get it to work. It just seems like the perfect place to put a fingerprint sensor, so why do phone manufacturers keep using in-display fingerprint readers over the cheaper alternative?
The pixels from 6 to 8 use an optical fingerprint scanner, and optical scanners almost universally suck, because they use a tiny camera to see your finger through the display on your phone. Most phones including the pixel 9’s include an ultrasonic fingerprint scanner, which is more reliable, faster, doesn’t flashbang you in the dark, and has the potential to be much bigger (think lower half of the phone is the fingerprint scanner).
I haven’t had trouble with under display fingerprint scanners since I had my S23 (ultrasonjc), but my previous has an optical one and it was the worst thing I’d used.
I’ve used standalone optical readers before, and the ones that worked well had a slightly tacky rubbery-plastic layer on them, that I think helps with making the fingerprint stand out. Obviously can’t do that on a screen, because it’d be weird.