If anyone is having trouble with nikon D3200 check your lens. The Nikon AF-P series lenses are not compatible with D3200 only 3300 series onwards. Hope this helps.
I struggled with this for literally years. We got a D3200 as a wedding present and it would be terribly unreliable for actually taking photos. Great when it works but that would be infrequent. I agree that it’s focus related, and a good lens cleaning seems to have finally fixed the issue for us .... for now.