I don't know why you're being down voted, but you're right.
A diver doesn't just "run out of air". A diver gets low on gas because they failed to look at their gauges, and/or didn't plan properly.
It can happen that you get a free flow on your regulator, inflator, valve or manifold, but none of these make you run out of gas immediately. You have time to swim to a team mate and breathe from their regulator (if you are on a single cylinder and can't close any valves).
If you have a valve rolling-shut (implying you're on a twinset), you _will_ run out of air until you open it again, and you would be trained to calmly open it, or just switch to your secondary regulator.
Running out of gas can be prevented by planning the dive and keeping an eye on your gauge, depth and timer.
You absolutely can just "run out of air". Equipment malfunctions happen.
Was on a dive where one of the girls hoses blew. She didn't remember her training and shot up to the surface - thankfully we were at ~5m already, but she still got the bends and they sent her to a decompression chamber.
Buddy was recently on a trip and had both his primary and secondary regs malfunctioned while deep. He was able to swim to his girlfriend, but he's been off-put from diving since then - and he's not inexperienced.
Having a buddy is nice, but honestly isn't reliable. Most of the time I'm joining a boat as a single, and while we have our group - it's really only the dive master that's paying attention to people. Everyone else is usually inexperienced or just doesn't even think to keep an eye on others because they're out on vacation.
And even when you do have a good dive buddy, you're not usually attached at the hip. Very often you're looking at something that intrigues you and your buddy gets bored to swim a few meters a way, etc. It'll happen 1000x times in a single dive.
I would still argue that no one ran "out of air" in any of those situations. They panicked and/or ignored their training.
The thing about diving equipment (especially regulators), is that they fail safe, meaning that they fail in a way that allows you to keep breathing.
When a regulator fails, it lets gas go. You can always breathe from it. The cylinder won't empty immediately, so you can get to your next gas source (your buddy, or your next gas switch depth) - cave/mine/wreck excluded.
A diver doesn't just "run out of air". A diver gets low on gas because they failed to look at their gauges, and/or didn't plan properly.
It can happen that you get a free flow on your regulator, inflator, valve or manifold, but none of these make you run out of gas immediately. You have time to swim to a team mate and breathe from their regulator (if you are on a single cylinder and can't close any valves).
If you have a valve rolling-shut (implying you're on a twinset), you _will_ run out of air until you open it again, and you would be trained to calmly open it, or just switch to your secondary regulator.
Running out of gas can be prevented by planning the dive and keeping an eye on your gauge, depth and timer.