Ever since the launch of the Galaxy Note9 a limited number of units were plagued by freezing of the camera app - the issue seemed to affect mostly those powered by the Snapdragon 845. The good news is that Samsung acknowledged the problem and is now working on an update that should fix it. In the meantime, if you are getting the "camera failed" message in the camera app from time to time, a temporary fix involves clearing the system partition cache. The confirmation of the upcoming update comes from a moderator in the US forums, but he couldn't say anything about an update rollout...
Source: https://www.gsmarena.com/samsung_working_on_the_camera_freezing_issue_on_the_galaxy_note9-news-34355.php