If you test your camera with a lens that is known to function properly you should find that the defect is in the lenses. I have the identical problem with a 10-30mm and 30-110mm lens I purchased used. I contact acted Nikon about a remedy and I have yet to receive a reply. That was two weeks ago and I am not holding my breath. This represents terrible production and quality control.
The problem is with the lens itself. Modern lenses require good electrical connections since mechanical ones are a thing of the past. I tested the camera with lens that work and performance is excellent. I’m sending off two lens for repair despite receiving no communication from Nikon. I’m sure they’re very busy. I’ll have more if and when this is resolved.
The problem in most cases seems to be that the plastic gear on the motor that opens and closes the aperture develops a crack. The gear no longer fits tightly on the axle, which just spins around unable to rotate the gear. A company called MYDC in Taiwan will replace the plastic gear with a brass one. Or they will sell you a brass gear to install yourself. I did the latter on my 30-110mm lens - and can say that repair is NOT for the faint of heart. But after doing it my 30-110mm lens now functions properly. BTW, I did have Nikon Canada do the same type of repair once, and the lens’ aperture mechanism failed again within three years. The repair part they used was not durable enough.