It probably happens when you have more than 65536 records. That's when Qlikview starts exporting to csv format. CSV doesn't contain formatting so no leading zero's.
Try reading some of the results from this search: https://community.qlik.com/search.jspa?q=leading+zero+export+format
Perhaps one of the solutions is what you're looking for.
If you have character columns or text values from a source you should always tell QlikView not to interpret the values but keep them as text by wrapping the column/field in the Text()-function ... then it should stay as text in QlikView too.
Text(product_id) AS product_id,
Actually I always recommend people to do that to make sure that QlikView doesn't mess up your character/text fields by misreading them as numbers... QlikView is a bit too eager to be helpful sometimes - but this is mistaken politeness.
Just tell QlikView - thank you - but no thanks by using the Text()-function.