No, there's no risk of ban if you're playing local multiplayer between a non-hacked and hacked switch with a non-legit game. I've done that a couple of times, both in local ad-hoc connection and LAN mode lan-play with other hacked switches and said unhacked Switch is still unbanned much later.