My buddy had the same issue. Sometimes it would fire up and other times not. Then, once fired and running, would quit and was almost impossible to start without taking some time and messing with the carb. He also had similar issues like you state. His problem, the gas cap was bad. Changed his gas cap, he hasn't had an issue ever since. He went through 2 new carbs among other things before discovering it was the cap. Hope this helps. Good luck.
85' Honda Big Red
09' Yamaha YZ 250F
2012 Polaris Sportsman 500 H.O.
2015 Polaris RZR 570 LE/Trail Edition
2017 Suzuki DR-Z400SM