Given how long game development times are nowadays, Switch is bound to get seven years minimum before its successor launches. Given that it's now Nintendo's only console, eight years or more are also possible. When the 3DS could have six hardware SKUs, Switch should see at least five over its lifespan.
The DS had six years for itself (with year 6 still managing 20m units) and that will be the decisive difference in this race. Switch doesn't need to reach the same heights or maintain as high of a plateau as the DS because it will have more time.
Switch was at ~49m by the end of 2019, so a timeline like this would be sufficient:
End of 2020: ~75m
This example gives Switch a cushion of 10m to beat the DS and it's not especially optimistic. If Nintendo properly supports this console through 2023, then the above sales progression looks fine. 2024 onwards is when the year over year drops get sharper because the big hitters will go to Switch's successor. What the above sales curve assumes is a transitional period that gets handled similar to how Nintendo handled 3DS to Switch where the old system kept getting low profile games for a couple of years.
Back in 2019 I would think a sales timeline like that would be absolutely ridiculous but now it's not that out there to me. Just seeing the Switch keep up with the DS during its peak for several months in a row is making me think it outselling the DS and PS2 to become the best selling console is a possibility. Also seeing that if the Switch ends up having similar declines to the Wii that it would still get above 130 million at this point is making me realize 140 million is likely the floor now since it shouldn't get abandoned that quickly. It'll heavily depend on when the Switch 2 launches but if holiday 2024 is when it does then there should be a real chance at beating the DS.