thank you for your explanation of the causes of the error.
Your suggestion seemed ok if I look barely at the script, but in the end it returned dates as
and repaeated values.
I tried to change Number override document setting
But still I got a weird format like
and, as I said, repeated dates.
but thanks for your inputs!