That's actually an interesting question: the new Nintendo leak suggested that the Switch originally would replace the 3DS well before 2018, so the initial plans were for the 3DS to be phased out earlier. The eventual shift to what the Switch became meant that they were going to position it more as a successor to WiiU at first. But Nintendo probably weren't as confident in the 3DS' longevity as you might think. The projects for the 3DS were mostly low budget affairs, anyway, more indicative to me of a contingency plan in case the Switch failed (in which case the 3DS would have remained more relevant anyway - but of course this didn't happen).
That said, they did see those games underperform beyond anyone's wildest nightmares, so the 3DS probably cratered quite a bit more than they expected. In the end, I think Nintendo didn't expect 3DS to be especially relevant, but did keep some support in order to be able to prolong it in case the Switch failed. What happened instead was that the Switch blew up and put the 3DS in an early grave.
Another reason why Nintendo might want to wait until 2024 is because they might be able to put out something that can rival the XSS, such that third party support is more feasible than for the current Switch. I feel there is some interest from bigger third parties who might want to dip their toe but who aren't willing to put in a Witcher 3-tier effort. Making a strong system might help Nintendo and third parties take the next step and increase their presence (not like PS/XB quite yet, of course, but a stronger presence than is currently the case). What we are currently seeing is that the big publishers with the demanding games (or who perceive their own games to be demanding, like Bamco) are the only ones really waiting on making ports, or forgoing ports altogether. Waiting until 2024 and bringing out a powerful system (which would be the cutting edge level that the Tegra X1 was in 2017) could make that support more prevalent.