Why does the pCO2 value increase during hypoventilation? If hypoventilation causes shortness of breath, would that not increase the CO2 concentration, therefore decreasing pCO2? What am I understanding incorrectly?

My chemistry teacher said that the pCO2 value increases during hypoventilation. Why is that? If hypoventilation causes shortness of breath, would that not increase the CO2 concentration, therefore decreasing pCO2?

Because if you think about pH, a larger H concentration causes a small pH since pH is the -log(H). Would the same logic not be used when calculating pCO2? What am I understanding incorrectly?