A Nintendo producer has come out and said plainly that Super Mario Odyssey was always meant to be a Nintendo Switch game, rather than a Wii U title.
Games development takes a long time. Games can take years and years to make, with development times of 3-5 years not being all that uncommon. Many games take even longer than that still, and when you exist in a medium that is consistently changing its hardware and capabilities, it's easy to see how complications would arrive. A team could be towards the beginning of one hardware generation when they start development, only to release on the generation that comes afterwards. Game development has to be nimble to pivot.
For one development team, though, that wasn't the case. According to Super Mario Odyssey producer Yoshiaki Koizumi, the title was always meant to be on the Wii U's successor. Speaking to GameInformer magazine (via NintendoEverything), he spoke about the decision, saying:
It was always planned for Nintendo Switch. We really were considering a lot of the hardware capabilities specifically for this game, and wanted to make the most use of them.
I think the idea of what the Nintendo Switch is became very important around here, because it can both function as a console or portable device. We really thought about what sort of software features would make the best use of those capabilities. Super Mario Odyssey really answers to a lot of that capability in the way we had hoped. We wanted to time it for year-end release to make the most of that as well.
Perhaps this isn't surprising, as this would have been done in-house at Nintendo, meaning the developers likely would've known what the core concept of the Switch was years before its announcement. It is an interesting look into how long the Switch idea was rolling around though as Super Mario Odyssey almost certainly took a few years to put together. Neat.