For reference, I had that exact same issue on my MBA - went on for years. Many times while watching youtube or doing something Garageband related.
At the time I had 10.11 on it, but that OS had itself been upgraded from 10.10.
When 10.12 came out, I decided to install fresh - so I backed everything up and installed onto a new SSD drive. The issue has now gone away completely....
Hm, my old Dellbuntu laptop does the same. It's been dropped a few times in its 10 years of service, and now sometimes will shut down if I tap it too brusquely, regardless of the temperature. The BIOS will report it overheated, and i don't know what's going on.