Breathing is an automatic function in humans, however, you can choose to control it manually. I think it would be theoretically possible (with enough willpower) to hold your own breath until unconsciousness, but at that point, automatic control would take over before a person could kill themselves by refusing to breathe.
There are hidden dangers in breath-holding in a sense of how it all works, it is not exactly automatic per se, but is regulated based on co2 concentrations, and the system isn't smart or perfect.
Here is an article about some problems involved, a bit on a for simple folks side, but still describes some problems:
The key to preventing hypoxic blackouts is getting to the root cause of how athletes faint when exposed to breath-limiting, high stress practices. The body’s autonomic nervous system controls our breathing at an unconscious level and bases your need to breathe on the balance of oxygen and carbon dioxide (CO2).
A build-up of CO2 in the body signals the response to exhale the toxic build-up of CO2 and bring in fresh oxygen to nourish our vital organs and muscles; however, when CO2 levels are relatively low due to hyperventilation, whether intentional or from a difficult practice, our brain loses the ability to signal to take a breath. It thinks we don’t have enough waste product built up to require a breath, when in reality, our body needs that breath of air to survive.
there is free diving aspect as well, a wiki page Freediving blackout
Freediving blackout, breath-hold blackout or apnea blackout is a class of hypoxic blackout, a loss of consciousness caused by cerebral hypoxia towards the end of a breath-hold (freedive or dynamic apnea) dive, when the swimmer does not necessarily experience an urgent need to breathe and has no other obvious medical condition that might have caused it. It can be provoked by hyperventilating just before a dive, or as a consequence of the pressure reduction on ascent, or a combination of these. Victims are often established practitioners of breath-hold diving, are fit, strong swimmers and have not experienced problems before.
yeah, and thinking about free divers, there are quite a number of high-profile cases, at least which got to be made into documentaries about them(okay, at least one), which got in the scope of a random guy like me.
All those above do not state specifically it is ANS fault, but Do Not count on it it isn't a fail-safe bug fixed microcontroller program that just works, it is a biological system.