Is possible that what was hacked is the save file of the game hence allowing for cheats without hacking the console itself.
Edit: Confirmed, the game will default save to a sd card if you have one installed, making it easy to either hack the save file or replace it with a hacked one. Since the Switch itself is not hacked, that tends to bypass getting banned. The same is possible for any Switch game that puts the save file in the sd card.