I had the same problem as described above: My back camera (also called main camera) was sometimes working, but sometimes it was not. In the latter case I saw only fine vertical lines in blue, purple, grey and black. After a while a message appeared stating that the camera could not be connected.
Fortunately I could solve this problem in the meantime:
-
I cleaned the three contacts on the back side of the main camera and also the three contact areas on the board vis-à-vis. I used a cotton swab and pure alcohol for cleaning.
-
I bent the three contact tongues a little bit more so the pressure between contact and contact area on the board is a little bit higher now. I used tweezers with a long needle-like tip for bending. Please be cautious!
Good luck!
Here is a picture with two of the three contacts marked red:
Here is my detailed original post in German some days ago: