What lens are you using?? Yes, if you are closer to a subject than a distance at which that particular lens is capable of focusing, the system will hunt and not succeed.
As a general rule, the AF system will do a good job as long as it has some subject in its AF points having contrasting elements and/or well-defined edges. It cannot, for example, focus on a blank wall or a clear sky. But all automatic systems can occasionally get it wrong. One of the AF points can grab onto something other than that one intends. The most accurate way to achieve focus is to set the AF points to center-only single-point spot AF, then train the camera on a part of the subject having a clear edge, achieve focus by using the half-press of the shutter button, then holding that half press to freeze that focus, you can move the camera for the composition you really want, then complete the shutter button press to fire the shot. For example, in people shots, such as portraits, using the above technique to focus on an eye, then recomposing to frame the shot, is recommended.
Last edited by mikesbike; 07-13-2020 at 09:09 PM.