Could it be influenced by something? Friends, video games, TV? Sometimes when kids do something out the blue there's usually something that's influenced it
I'd maybe sit him down an say that until he can give a reason then perhaps restrictions need to be put in place like not seeing friends, no gaming, limited or no TV etc, if he thinks he's going to lose something then maybe he will be open to talk about it
Totally not your fault though, with what kids have access to an with having friends that may have the freedom to whatever they want to view (social media, 18+ content etc) because their parents aren't bothered/not aware of what they are seeing, it can turn kids behaviour into night an day