A big share of those 240 million handheld gamers in the 7th gen is now the phone gaming audience; the casual players who mostly played stuff like Brain Age and Nintendogs, or kids now getting a tablet instead of a DS.
Comparing Switch's sales to the combined install base of DS + PSP is not an apples to apples comparison because of this; the explosion in phone/tablet gaming stole away a huge amount of that audience, and Switch has to compete with that whereas DS and PSP for the most part did not.