Some part of the camera module hardware gets lose or displaced under some certain vibrations and with use. Once that happen, it fails to respond properly for the software that is driving things. It is why this issue happen is none existing fresh out of the box.
I ride a motorcycle, and mount the phone in the handle bar. Had to replace the phone 1st time and module on the 2nd phone. Then sold it because I really believe the note 9 camera module can not withstand vibrations.
Many of the folks reporting the issue here start seeing it after their phone witnessed a normal drop in a protective case. I would assume the vibration from the dropped caused the camera module parts to shift or losen up, resulting in the issue being reported here.
This is my assessment and I am done from messing around with Note 9 since Samsung not recognizing there is a serious problem with the camera module under vibration. I mounted my note 8 on the same bike at the same location for a full year and never an issue. Now I am using Pixel 2 XL. Good luck all.