As stated in the documentation https://docs.mendix.com/refguide/parse-and-format-date-function-calls#3-formatdatetime-utc the formatdatetime function returns a string.
In the change object you are therefore trying to set a string in a datetime attribute, resulting in the described error.
To solve this issue with the export to JSON create an alternative duedate attribute of type string and set the result from the format function in this new attribute and use this in the export mapping to create the correct JSON.