retail(cartridge) games for the Nintendo switch can be sold without problem, although any codes for extra content and the coin rewards will not be accessible for the new owner if they’ve already been redeemed.
Currently there is no way off selling your digital switch games.
Can you trade in digital switch games?
You can now share your digital Nintendo Switch games with other consoles. You can now download and play your digital Nintendo Switch games on another Switch console with minimal fuss, thanks to a new system update.
Can you copy Nintendo switch games?
Yes, there is such a thing as a free lunch. But if you hack your Nintendo Switch to play pirated games for free, that comes with a cost: You can’t play online. Try to play a copy of a game that was purchased on another console and with another account, and boom, your Switch is banned.
Can you transfer switch games to another account?
Yes there is. Switch users can now set a console as their primary console and another console as their secondary. He can just log into your Switch, set it as his primary console and then download the games there. That way you can access his digitally bought games on your own console.