I had this problem on a couple different S7 devices in my shop. Almost always after a device wipe. I tried a lot of aftermarket replacements and none of them worked. What DID work was replacing the rear camera with one from another S7 I got that was run over by a truck so they actually just donated it to my shop after I recovered data.
I searched a lot around on troubleshooting resources and kept ending up with it being a firmware issue with the camera itself