Yes, it could have been shorter to avoid your issue, but personally I would throw a 5mm spacer on top and call it good. It's in the rules!
- Rule #45//
Slam your stem.
A maximum stack height of 2cm is allowed below the stem and a single 5mm spacer must always –always – be stacked above. A “slammed down” stack height is preferable; meaning that the stem is positioned directly on the top race of the headset.