I have no doubt that she asked him repeatedly why he was doing it but either he couldn’t answer or by that point the shame and pressure from himself teacher created a mental block that prevented him from answering.
Taking the pressure off is absolutely the right thing to do.
This reminded me of a UI Design principle, that users themselves often don't understand why they dislike a user interface, so their complaints and requests need to be explored, rather than taken at face value. Otherwise, when the first request is implemented, it may then replaced by another, and again, until the root cause is uncovered and addressed.
A very fuzzily remembered example was something like puzzling requests for data-entry form tooling, and the root cause turned out to be a multiple-page form lacking a "I can see it all, and see that it's right" confidence property, which was resolved not with tooling, but by simply making the form a single page.
One strategy I've found that can sometimes work is to engage with them in problem solving. Asking them what they think would help or if you have a guess, an action that corresponds with that guess. I've found its usually a more reliable source of information.
The internet is a boon for these things too. I know the author didn't have Google 23 years ago, but now there are a lot more resources to get on the right track with many strange kid behaviors, so it's like parenting in easy mode now.
Also, in this case the undesirable behaviour had a perfectly benign and easily fixable root cause, but that's not always (or even mostly?) true. In many cases my kids will be misbehaving because they're not getting what they want, eg. icecream for dinner or to not go to bed on time. In cases like these, it's the parents' job to say no. Of course it's very important to understand the child's real motivations but often it's going to come down them just wanting something they can't have.