After Hyperventilating for some time holding the breath is dangerous because –
In our body its not O2, but CO2 that maintains the respiratory drive (though main function of respiration is to maintain adequate oxygen level in the body)
Thus its not hypoxia but hypercarbia that is required to inform the brain that respiration is inadequate.
If normally a person holds his breath he will soon have decrease O2 level (hypoxia) and increase CO2 level (hypercarbia)
Hypercarbia will stimulate the brain and increase the respiratory drive, forcing the person to take breath.

Lets see what happens when a person hyperventilates

Decreased PaCO2 of blood
Normal O2 saturation (despite hyperventilation arterial O2 saturation remains same as blood is almost fully saturated at normal ventilation rate)

Lets see what happens when such a person holds his breath.
● Soon his blood O2, level will fall (hypoxia) but his blood CO2 level will be normal or below normal (as he was hypocapnic due to hyperventilation)
● His blood O2 level will continue to fall, but his CO2 level will still be not high enough to stimulate the brain for respiratory drive.

The person will continue to hold his breath and his O2 level may fall to lethal levels without any respiratory drive (his brain is still unaware that he is in danger of dying from hypoxia).
Decrease CO2 shift the O2 dissociation curve to the left
Alkalosis can lead to tetany
It can lead to CO2 Narcosis
Due to lack of stimulation by CO2, anoxia can go into dangerous levels