I don't think my mortgage lender has ever inquired about the age of the roof on the purchase or during any refinances. For my first house, I bought it with a roof that needed work, had some small leaks, and was well beyond its design life. I got a mortgage without the bank bringing that issue up (albeit in 1996).
Home inspectors look at these things and buyers might choose to walk away based on the inspection report (which the bank never saw on either of my purchases).
It probably helps that the entire house could just disappear and the price for the lot would only change 10% or so.
but used cars seem to do fine, even though they can be similarly damaged?
7000 figure from: https://news.ycombinator.com/item?id=29081118
Repair costs are also better known and less daunting.