700efi rough idle then dies

I’ve got an 05 sportsman 700 with about 1000 miles that I’m having some issues with. I went for a ride the other day close to home since it hasn’t been started in a few years everything seemed fine so I kept going after getting about 15 miles from home I stopped turned it off for a few mins. When I went to start it it barely idled then sputtered backfired and died. It seemed to be starving for fuel. Long story short the only way I go it home was by turning it over then holding it wide open and it would go ok like that but the second I let off full throttle it continued to loose power until it rolled to a stop the spudered and died did this about 15 times and I was home. So I thought fuel pump or filter- no bypassed filter and checked fuel pressure at rail 40 lbs. next I dumped out all the gas put in new gas blew out the lines … Nothing so I changed the plugs and changed air filter… No difference… So I took the throttle body apart cleaned it pulled the injectors out to see if they had melted or something.. Looked fine… I checked voltage on the tps I have .48 yellow wire and it goes up as i press the the throttle. If I adjust the throttle cable it runs worse. I took apart the air flow sensor cleaned it. Nothing made a difference if I unplug the air flow sensor it seems to run the same. Except I get a code. Other then that I don’t get any codes and nothing I do seems to help. If it was the Bap sensor or the tps sensor that was bad wouldnt I get a code for it?? I’m leaning towards buying a new mass airflow sensor or whatever polaris calls it. Any help would be great.. Thanks in advance.