My wife's iPhone 15 Pro Max does not focus using the .5x and 1x lens. It works properly with the 5x. She has been working with Apple Support to resolve the problem, with no success. Apple engineering claims it is a software problem and they are working on it.
This appears to me, an electrical engineer with much computer experience, to be a hardware problem. Apple diagnostics do not detect a failure. But, you can see the problem with your eyes, their diagnostic is deficient.
I have the exact same iPhone as my wife, and mine focuses properly on each lens. Identical camera's using the same software where only one fails is a definite indicator of a hardware failure.
We have asked Apple to replace her phone. By declaring this a software problem, Apple prevents the support team from a mass replacement of failing iPhones. There are a lot of iPhones that have this problem.
Apple is trying to find a software workaround for this hardware problem, but have not succeeded so far. It's now Christmas season and many Apple customers with the flagship iPhone have a useless camera.