Do universities prefer not to hire their own PhD graduates in faculty positions? I have heard that universities tend not to hire people who earned their PhD there for professorships (tenured or not). (I've read this question, but it's about postdocs: Is it normal that research institutes do not hire their own PhDs for postdoc positions?)

If one graduated from a university, and then did a few turns as a postdoc or non-tenured professor, would a university/department still be disinclined to hire them 10 years post-graduation?

I know there's a lot of factors that go into hiring professors, as well as many reasons to go to different universities/institutes (addressed in the linked question), so I'm mostly curious about this specific truism I've heard.

Although I live in the U.S., I'm curious about North American and European practices (so as not to invalidate answers already given).
At my university - or at least in my department - the norm seems to be that they prefer to hire externally for tenure-track jobs (speaking from experience serving on a search committee for a tenure-track position). The line of reasoning is, "if we're the ones who taught/mentored/molded Candidate X, then they're not bringing in anything new in terms of scholarship."

This is less applicable to non-tenure track jobs, as those faculty members are usually teaching lower level classes and don't have any research obligations. There are several PhD faculty members in my department that were hired internally who work as lecturers.

Anecdotal, of course, but I've studied at/worked at a few universities over the years, and this is the pattern I've tended to see. Tenure-track: external. Non-tenure-track: internal OK.