When you start your next project, go with the G/H series and don't look back!
One risk I see, but don't know enough to quantify, is that the 407 has clearly turned out to be immensely successful but we don't know about the successors.
The 407 is the same chip as the 417; factory programmed to switch features on/off. So that's probably ok too.
The immediate successors like the 437 (64k more RAM) and probably 439 (more peripherals) are more distant although I can see the 437 being a success due to the 64k more RAM. RAM is a rare commodity in all these chips.
But a lot of the others may not be so successful. OK they do 500MHz but who needs that?
One can get a good idea from stock levels at distributors of what is selling. I've always tried to do that. Mostly it is blindingly obvious, although these will not show the large-OEM user volumes. Enter a partial P/N like STM32F417 and see what comes up. Maybe not right now because lead times are still stretched ex-covid. But the 407/417 types win by a big margin. The 437VGT6 (basically a 417VGT6 with 64k more RAM) also looks good. Go much beyond that and the volumes look smaller. Maybe because a lot of those ~500MHz chips were targeted at specific high volume OEM applications?
ST guarantee a 10 year production life (see previous link) and usually this is improved on, IME by another 5-10 years. Then you get the LTB so you can buy a lot of stock if the product is still selling.
I recall from ~30 years ago when I did 2 products.
One used an H8/300 and the LTB was around 10 years ago, so roughly 1985 to 2013 = 28 years. They were £9 but ~15 years ago I bought tens of k from US cowboy dealers for $6
Great until the ch1nks woke up to another opportunity to steal money and started making fake ones, empty package; then this trade stopped.The other, which I did as a consultant, used an H8/500. Also started c. 1985 but was a dead duck 10 years later.
Also the benefits of not having to continually redesign are huge (if it is your own business). You can waste your time on more productive activities...
Of course if you are a hw + sw dev then the benefit is zero
I recall when ROHS first arrived and a vast number of products had to be redesigned or scrapped, and vast parts stocks had to be scrapped (of course no small company did that; they just declared compliance, often using the Control & Monitoring exemption
) there were loads of devs posting in the various forums saying how wonderful an opportunity ROHS is because it "promotes innovation and creates opportunities"
For every loser there are is an army of winners.