If the stop wire tests ok,on some models there is a ground wire that grounds the rubber mounted gas tank(where the stop switch is located) to the crankcase,the wire strands can break inside but the rubber covering remains intact making the wire appear ok. The fix is to replace it.
Also on onlder saws the small cylindrical brass terminal on the end of the stop wire can get flattened or distorted and not make proper contact with the ground spring,also the ground spring can become distorted,causing the two to not make proper contact, The best and easiest fix is to replace these 2 inexpensive parts.