From the article, it sounds like everyone was playing by the rules.
It went South when the passenger, when asked, said the gun may have been in the glove box. That contradicted what the driver told the LEO and is probable cause that a crime may have been committed.
That the driver was cited with a warning kind of makes me think there might have been an additional traffic violation issue. From the quotes in the article it appears the driver slowed down when they realized LEO was behind them. If they slowed to below the speed limit by a lot, it may have awakened the officer's spidey sense.