Do modern, well designed circuit breakers and/or panels have a 25-40 year lifespan?
I suspect part of the problem may be AFCI, GFCI and other recent advancements. A simple panel is totally passive - as long as there are no loose connections causing sparks/arcs, and actual breaker trips are not very frequent, there is little to wear out.
However, code has changed over the last few decades to mandate AFCI and GFCI protection. Breakers which include AFCI and/or GFCI protection have complex electronics - in many cases actual microcontrollers - and are therefore much more susceptible to wearing out, just like any other complex electronic device. In fact, many of these devices now have built-in automatic testing to help avoid surprises.
On the other hand, I have read many times that typical large appliances (refrigerator, dishwasher, clothes washer, dryer, etc.) have 10 - 15 year lifetimes. But those devices can often be kept running far longer with relatively minor repairs. In other words, YMMV.