Sometimes you can get back both cameras working just simply by restarting the phone.
Other method is as mentioned by our friend up there, by clearing cache and so on through recovery.
Best regards and stay safe.
Had that problem a few times with different ROMs now and figured out that the only thing that worked for me was flashing the StockRom.
So I flashed Stock, after that the latest Lineage 17.1-ROM from Feb. Magisk and Nanodroid and its running quite stable.
Once the camera stoped working but a simple restart solved that one.
Where can I download the new build?
oops.... found https://drive.google.com/drive/folders/1ZiS-oLwpxRBbBkKdizFbmtejNGuMjsUs
#include <std_disclaimer.h> /* * Your warranty is now void. * * I am not responsible for bricked devices, dead SD cards, * thermonuclear war, or you getting fired because the alarm app failed. Please * do some research if you have any concerns about features included in this ROM * before flashing it! YOU are choosing to make these modifications, and if * you point the finger at me for messing up your device, I will laugh at you. Hard. A lot. */