That is not BUG from this ROM, i had same problem on Global MIUI ROM, and it happens when i use *no-support-for-this-app-on-this-forum* and Stock camera to make comparation of photo quality, when switching from one to other.
try this way if your camera does not work. step 1) download a widget called GoFlashLight. step 2) every time you miss the message "can not connect to the camera", just click on that widget, and it will turn on the flashlight, we will riclicchi above and the flashlight will turn off, now (maybe) your camera works
That is not BUG from this ROM, i had same problem on Global MIUI ROM, and it happens when i use *no-support-for-this-app-on-this-forum* and Stock camera to make comparation of photo quality, when switching from one to other.
I have the same problem, already for a long time with my MI5S, since many roms ago already.
I wonder if it is not a hardware issue, I cleaned the cache, formatted the whole device and reinstalled everything already a few times but now and then this error pops up again...
go to the settings on your camera app, unselect the option 'enhance lowlight photos automatically' this should solve the camera problem on your main camera's. this will not work for selfie mode.
using third party camera's is also an option.