One should read the POH on this one.
The action of switching off BOTH mags checks for the very rare magneto switch failure case where individually they check out but together there is a problem. I cannot imagine how (mechanically) this is possible but I suppose one cannot completely rule it out.
My (TB20) POH says you can do this but only below 1000rpm otherwise you risk exhaust system damage.
I never do it. Did it once a few years ago and got a big bang.