Misleading Inflation YoY CPI?

Hi! Not an economist, just interested.

Suppose prices shoot up 10% overnight, but for the next year absolutely nothing moved, perfect 0.

Exactly one year later, CPI YoY would show as 10%, right? But exactly one day later, we would have a YOY CPI of 0%, no?

In fact, if prices stagnated for 5 more years, it would still be something closer to 1.8% a year (considering the 10% increase "amortized" over 5 years), yet wouldn't News articles scream stagflation, as YoY CPI would say 0% for 5 years?

Would love to know if I'm getting something wrong here.

Am I completely getting this wrong?