It's all down to that logo on the controller. Everything else, from buying up Joy Cons to modifying them to reselling them (with the word "Joy Con" in the item description) is perfectly legal. Modify the logo so it doesn't look like a play on the official Switch logo and it should be all copacetic.
I will say, though, that Nintendo is a lot more militant about these sort of things than other big gaming companies. They go way beyond what is necessary to protect their IPs. Maybe this particular instance was necessary because it involved a trademarked logo rather than a copyright, but some of the things they've shut down have been permitted by other big companies. For example, I know that Microsoft and Sega allow things like fan games, and they are not at risk of losing their IPs. Nintendo garners a lot of good will by making great systems with great games, but they squander that good will by shutting down nearly everything notable they didn't explicitly authorize.
They're even squandering it with me.