formatDate JS function not working in Bot

We are trying to format an ISO date returned as part of API call in bot dialog using the formatDate JS function however its not working and returning ${{#formatDate('2021-09-13T20:17:03+0400','yyyy-MM-dd\THH:mm:ssZ','yyyy-MM-dd')}} something like this.

We noticed if the date does not have T in the string then it works fine.