Cam failure... could be hardware, most of what I've come across were hardware... Camera module defect or such.
You could submit error report to Samsung Members after reproducing the issue once more. Or for more immediate action you could visit UBreakIFix or Batteries Plus (samsung certified repair centers) if any of those are near you.
Please share the device's model number and the software version. Lastly, is the camera app updated?