I once flew a PA28 (cadet) that had its compass swung with the pitot heat OFF. Trouble is, pitot heat on Jesus! About 20 plus degrees difference. Massive argument ensued, ended up with all the compasses moved up from the combing away from the electrics.
My understanding is compass swing should be done with all electrics ON, and that annotated on he back of its card.