The valley has enough nooks that if your discrete, dont make a fire, or a mess, and are moderately sneaky, you can easily stealth camp on foot. Im not going to post specific spots publicly so they dont get blown up. Look around and you’ll find them.
Steath camping the valley in a car is very difficult if not impossible. They check all the parking lots at night. Even the trailheads.
As for the high sierra, literally the only time I have ever been asked for a permit in the backcountry in my entire life was coming out of tuolme meadows south towards donahue(?) pass. You coud just walk on the other side of the valley to avoid that specific ranger patroll, there usually not terribly observant.
Beyond that your really only going to have a chance of encountering backcountry rangers within 2 days walk of any trailhead. High use areas basically, and any zones around the backcountry cabins which are shown on all the maps. This only applies to park service rangers, in my expirience the forest service back country people don't give a fuuuck.
I pretty much dont bother getting permits now, I never see the rangers, and its so easy to dodge them anyway why waste the time? The trail system is so extensive too, once your get off the pct corridor its not uncommon to go a week without seeing a single person if your deep enough in the wilderness. Dont worry about it.
Consequences if your caught? well if its LE rangers they are cops, so all the usual cop bullshit. Other rangers… idk, you could probably just walk away and dare them to do something about it. what are they gonna do, try to fight you in the middle of the wilderness?
And remember, pack out every scrap of trash, and NEVER leave your shit unburried or shit within 150’ of water. If you do, smokey the bear will skullfuck you in your sleep.