Since playing Pokemon Sun on my original 3DS, I've found that certain moves cause it to crash, like Fake Tears, Water Sport, and Mud Sport. It also happened when my Sableye used the Normal Z-Move but not when I've had other pokemon use that same move. The crash only ever happens during combat and when certain moves are used. It does not present me with any error code.