Earlier today, Game Informer had an interview with a number of people involved with bringing Cuphead to Switch, including co-creator Jared Moldenhauer. When the question was asked as to who exactly prompted the project to take form, Moldenhauer remained silent while Nintendo's Kirk Scott said he didn't know how it happened. It seemed like everyone was being a bit coy about the situation, but now we have a bit of insight that makes things more clear.
According to Daniel Bloodworth at Easy Allies, Cuphead developer Studio MDHR told Mr. Bloodworth that it was Microsoft who approached them to ask if they'd be interested in a port to Switch. That definitely gives us some more insight, but it doesn't answer the full question. Did Microsoft come up with the idea and pitch it to Nintendo, or did Nintendo ask Microsoft, and then Microsoft took the idea to Studio MDHR?