Chosen Solution
My front camera works fine, my flashlight is also working fine, but whenever I try to flip the camera to the rear it glitches a couple of times between front and back and then when it finally shows the back camera it’s nothing but a black screen. Nothing is covering my camera and there’s no scratches or any visible damage to the lens, could this be a hardware issue? (It doesn’t work in third-party camera apps either)
Your camera is likely broken. Replacing it should help. iPhone 7 Rear Camera Replacement iPhone 7 Rear Camera
If you have ruled out Upadtes and restore It will be hardware. Replacing the camera will sort this out for you.