It is generally caused by two reasons. The first is the problem of the camera cable itself, which does not involve the motherboard. This only requires replacing the camera or repairing the cable.
The second is related to the motherboard control chip or CPU, which needs to repair the chip or replace the CPU. In case of warranty, just take it to Apple after-sales service for maintenance.