Yes the main product should get duplicated, but not the secondary materials or catalysts. In this case I finally found out why it was weirdly behaving: Space Exploration itself created some of its recipes in a weird way, I am assuming its legacy code, as it omits the associated fields from the array of any product from a recipe, for example:
{ "se-junk-data", 3 }
instead of
{ name = "se-junk-data", amount = 3 }
and I was only checking for product.name, which was nil for all cases where it was initiated with the above mentioned reduced code.
But I fixed it, and it now finds all recipe products properly and their amounts and can flag them as catalysts so they wont get duplicated with productivity.
Also, the reason it flawlessly worked for all liquids, is because they NEED to have these fields, as well as the type field (for type = "fluid"). I hope this clears things up and I hope I didn't overlook any recipes where some byproducts are still getting affected by productivity, let me know, if thats the case.