You have to give a place and a time frame for these things, there are some places that did see 40% yearly inflation for multiple years in there (along with years of say "only" 10%). So while year on year inflation isn't consistently running at 40% it is still running very hot. Specifically some of the areas outside the major cities have seen spectacular inflation in house prices. A colleague of mine sold a house in Ontario for 200K CAD or so in 2016, same place now recently sold for a bit under 500K. While that's not quite 40% year on year it's close. Sure this is just an anecdote, the place could probably have sold for more the first time around especially if more renovations were done, but there's a lot of such anecdotes and I think that's why people throw around numbers like 40% because that's what they've seen lately and perhaps lack the numeracy or data to look at the bigger picture more accurately. In fairness the inflation in that broader geographical area of that anecdote is "only" 110% over the last 5 years. But the fact that 110% inflation can have happened in 5 years across a broad geographical region is just nuts.
But yeah there's places like Barrie Ontario that are like +70% in 5 years, Hamilton 70%, Oakville 68%. All those three are around +30% in the last year. Then there's some places that were previously cheaper areas like Niagara falls that's +93% in the last 5 years.
Toronto for comparison is around 70% over the last 5 years but 15% in the last year which shows that the Covid situation has meant that inflation of property prices in the major cities has slowed compared to areas surrounding. Given that wages haven't gone up much these numbers in the real estate markets are just nuts. I can't imagine this is good for the stability of the broader banking system over there.