Even if you own a roulette wheel, letting a gambler bet you your entire net worth (or even sizeable % of it) in a single wager is a very high risk thing to do, despite the fact you have a clear edge and will win over time in a very stable manner as they make repeat bets.
The main problem for investors outside of people already sitting on millions+ is it is very hard to diversify real estate properly across geographies. Anyone sitting on a single house in suburban Detroit will have a very different opinion on the risk of real estate vs someone who bought a house in the Bay Area twenty years ago.
The great lure of housing is it often looks much more stable than things that are traded by the second, but this stability is often purely ephemeral and driven by the fact people just buy and sit on them for ten years+ without asking for a bid on their house so just see a (often mostly inflationary) gain of x% after y years and think it's very low risk vs the wild swings they see in stocks day to day.
Generally though, a random single house bought and held over ten years will often have a more volatile profile than a basket of stocks you just bought and forgot about for ten years. The great advantage of stocks in this context is you can easily buy the equivalent of 30+ 'houses' even on a very low budget and manage your risk better - something hard to do with houses on any net worth sub millions+.
Houses also have very high transaction and upkeep costs, which also heavily eat into rental incomes and overall growth (which lowers your return and increases your risk), and in the case of bad tenants can massively add to the risk of the investment (talking here of people pulling out the plumbing for scrap, vacationing and leaving the upstairs bath tub overflowing for days etc).
In short, a single house (particularly bought with large amounts of leverage) can be unbelievably high risk. A well diversified and well managed real estate portfolio can easily be very low risk, with a huge amount of options in between, so it's hard to say much more of note without knowing more about what you're intending to do and your net worth etc.