Hi @gunjan,
Have your solved your problem?
I agree with your thought almost, the formatDateTime() function requires its first parameter to be a datetime string which match ISO 8601 format, if you provided a empty value for the first parameter, the formatDateTime() function would fail.
More details about the formatDateTime() function, please check the following article:
formatDateTime() function
You could consider take a try to add a Condition to check if the date value is empty, if yes, do nothing, if no, convert the date value using the formatDateTime() function:
If your problem is solved, please click "Accept as Solution" so that this thread will be marked for other users to easily identify if your problem is solved.
Best regards,
Kris