According to the OU and other kashrus agencies (https://oukosher.org/passover/articles/chametz-when-to-peddle-when-to-purge/) cookies and even licorice are considered chametz gamur which one may not own on Pesach. However, is not the halacha that מי פירות אין מחמיצין, and therefore anything which does not contain water should not be considered chametz? (Even though Ashkenazim do not eat such things on Pesach.) See Be'er Heitev 242:2 who says ושכר המדי: וכולם על ידי תערובת מים דאל"כ מי פירות אינן מחמיצין. Why then would one not be allowed to keep such things on Pesach?
The OU itself (in this linked chart) specifically states that:
Flour as an ingredient in processed food is typically exposed to some form of moisture and should be assumed to be Chametz.
As an example of this, per Wikipedia here, licorice ingredients are dissolved in water and heated during production, so they would certainly be Chametz.
However, even if the products you mentioned contain no actual water (as if they contained even a little bit, it would be chametz, as you note) and do not come into contact with any water, in most cases, the flour itself is considered Chametz according to many authorities. See DoubleAA's wonderful answer here for the full discussion on what might make flour Chametz Gamur or Safek Chametz Gamur (in fact, many opinions prohibit selling it).