Another reason for the same is if the “Sensors off” option in settings is turned on .. it will give an obscure response as “Security Profile prohibits use of Camera”
5 Ways to Fix Camera App Not Working on Android Issue
Is the Camera app not working on your Android phone? Here's how you can fix the problem and use the camera again.