I conveyed my excitement about the Nikon D850 focus stacking in Nikon D850: 'Focus shift shooting' Feature Most Important Feature since Live View; Focus Stacking is the ONLY Solution to Full Resolution Images.feature for
Autofocus can wreck your focus stack. More specifically, it can either place focus too far away to start (what I saw) or too close (wasted extra frames).
The only approach I recommend for focus stacking focusing is magnified Live View at full aperture*.
Here is what I saw: I watched the D850 focus at the shooting aperture in magnified Live View. I then toggled to full aperture just afterwards and saw major blur, which means that the D850 cannot focus where desired with the lens stopped down to the shooting aperture. I observed this repeatedly and at will. The solution is to focus only at full aperture: dial the aperture open and then use AF, or pop the aperture open and focus manually.
* The top button at camera front will toggle between full aperture and shooting aperture while in Live View.
Conventional autofocus is pretty good, but it is just not good enough for the precision needed for focus stacking for many subjects. Do NOT use conventional autofocus for focus stacking purposes. The whole point is sharpness, so why risk it?
Below, 3-frame focus stack. That leading tree is impossible to get sharp without focus stacking (if one wants the distance also sharp).