Hi Marco,
I did some changes in your OML please refer the attached OML,(Change the format of default value of date for your local variable "TextVariable").
In outsystems the default date is in "yyyy-mm-dd" format and for FormatDateTime() also the input should be in the form of "yyyy-mm-dd" and your are passing date in the format of "dd-mm-yyyy" format thats why you are getting null value all the time.
Hope this will helps you
Regards,
Vipasha