Solved quickly, but using a method which I don't completely understand.
I added this line to the script to coerce all fields to be tagged as date:
Tag Fields '*Date*' With $numeric, $integer, $timestamp, $date, $day;
This did the trick.
However, I don't get it, why do I need to assign these tags manually to the columns that already come from a database where they have "date" datatype. If you have any clues on Qlik's field tagging, I would really appreciate your input.