Chosen Solution

Is it a lens or a sensor lens that is making the screne go black when taking a pic?

@planbee if your picture comes out black as well it is most likely a sensor error. If the pictures come out properly but the screen turns black it is the LCD.