Pardon me but this is a Misleading thread
Switch is both a handheld & console, and its a true successor to the 3DS
So going by your metric, last gen should be 37.86 Million counting the 3DS &Wii U (not counting the Vita)
Also you didn’t differentiate between Switch and Switch lite despite the Lite being 100% Handheld