How to fix this problem depends on what you want to achieve 😉
if(
empty(outputs('Compose')),
null,
formatDateTime(outputs('Compose'), 'yyyy-MM-dd')
)
This assumes that the date is stored in a Compose (outputs('Compose')) and if it's empty you want to return null.