Hedging my bets here, but from personal experience with a gen 1 klr, the problem was the petcock itself. It started misbehaving in the way you describe and after lots of messing about/ attempting to fault diagnose, I eventually borrowed a fellow klr rider's petrol tank and the problem was "solved". I diagnosed that the culprit was to do with the vaccum pipe/ system from the petcock to the motor block that allegedly is some sort of "safety feature"  that when the piston isn't going up and down (the engine is off...) no fuel is going to the carburettor.
I solved my problem on my tank by dismantling the petcock assembly completely and making it permanently "on" gravity fed "straight through" with the vaccum pipe/ rubber gasket in the petcock and on/off switch disabled. A leatherman/ lockwire and petrol proof gasket sealant is what I used. Also a search on eBay USA (dot com) of aftermarket klr petcocks (gravity only, without extra/ useless features) showed I wasn't the first with this problem. But being in El Calafate in southern Argentina meant I wasn't buying anything like that from the USA in a hurry. My "bodge" lasted many thousands of miles until I sold the bike.
Good luck sorting the situation.
|