Investment risks are a spectrum. Real estate loans are lower risk than stocks or investing in crowdfunded real estate deals, but of course riskier than investing in US treasuries.
The biggest risk to a real estate loan is that the value of the property drops by more than the down payment. Since we always require borrowers to make a down payment of 30%, a property would need to default AND lose about 30% of it's value before you start to lose principal.