I haven't had this on the Husqvarna but did fight this type problem on Homelite chainsaw. I did nearly everything the OP did.

I would try disconnecting the kill wire as Grumpy suggested to at least eliminate a possible intermittent grounding of the kill circuit.

The problem on my end did turn out to be the electronics in the coil causing spark advance problems. It did at one time even set the air filter on fire. I mean this chainsaw would backfire and afterfire whenever you tried the accel from idle and other times run prefect.

The in-line tester is fine for finding a missing spark but it will not tell you that there is a timing issue. From the description of the problem that is probably what is going on.

I don't the cost in your area but here they only 40 usd with shipping.