2010 sportsman 550 backfiring fix

Got to operating temp than ran like crap, backfired violently and died out. Cooled off and ran great. I had my 2010 sportsman at the Polaris dealership for two months. When this first happened there was a way to read a code on the quads computer, it stated crank trigger problems. The dealer could not find any faults on their computer. They went through every sensor (trigger was reading 193 oHms), fuel pump, wire harness, even the onboard computer. The dealer stated they hooked it up via link to Polaris as he drove it, it craped out with nothing showing.
The Polaris brain cells ask my dealership how many miles are on the quad and he stated 2000, they concluded it was an internal problem pointing at the cam. Their theory is the cam is getting hot and holding the exhaust valve open…….. (yes I know it should be the opposite and I told them so)
I said no way, when it’s cold it runs great, idles fine and revs and drives smooth. Now the dealer said to replace the cam you have to pull the motor and at this point you should replace the top end since you got it out….. ~$2000 and no guarantees. I said nope and took it home.
I let it warm up, drove it up and down the driveway till it started craping out, hit it with a water hose to cool it down and it started to run great. Right now you are thinking WTF, got it running crappy again cooled off the ignition mod, it did nothing so I said this is not a cam issue. Cooled it down and started wiggling wires. I grabbed the crank sensor or trigger and it shit the bed. Wiggled it and it ran great.
The two trigger wires that ran through the hard case boot , one was broken and barley connecting when the case got hot the wires separated causing it to run like crap.
The end hope this helps in the future.