is this what causes petcocks to fail?
No, they just fail when they don't get used for ten or twenty years. Then they leak, just a little bit. When someone parks the bike, the fuel evaporates out of the right two carburetors and they stay dry, but the leaking petcock keeps refilling the left two, since on the side stand they are on the down hill end of the passages that bring fuel across to all four carbs. The gasoline that turns into the dried old crap keeps getting replenished, the left two get more and more crap in the bottom of them. After a few years this crap turns to varnish, and it ain't coming out without a proper carburetor cleaning.
Replace the petcock.
Clean the carburetors.
Read up on all of the other systems that need periodic maintenance, and which can hurt you seriously if it is not done.
Like wheel bearings, tires, brakes, steering head, forks, shocks, the whole electrical system and pretty much all of the other parts of the motorcycle.
Restoring a bike that's been sitting and making it safe to ride again is a lot of work.