Hi! Welcome to the samsung members community!!
1)
Check for system and app updates. An outdated operating system or app can cause this camera error
2)
Power up in Safe Mode, then check to see if your camera works properly. If it does, the problem could be a third-party app that conflicts with the camera software.
3)
Restart the phone in regular mode and remove recently installed or updated third-party apps one at a time until the problem disappears. You may need to restart the phone after removing each app to ensure it's completely deleted
Remove and then reinsert the microSD card. Occasionally a Galaxy phone camera encounters an error reading the SD card, which can cause the Camera Failed error. Reformat the card if prompted
When you say you've cleared the cache partition do you mean both the camera apps and the entire phones partition?
Keep in mind to plug into a pc
https://www.samsung.com/uk/support/mobile-devices/how-do-i-clear-the-cache-on-my-device/?srsltid=Afm...