Fix invalid date error in field calculation

Hi clubbers!

I am trying to set a value on a custom opportunity checkbox field based on the formula "If the expected close date is entered and is before 1 July 2021, set the value to false, if it is after 1 Juy 2021 then set the value to true'

The below formula is validated in Studio 


However, on our log file I keep getting an error 'Exception evaluating expression in SetValueAction, ifElse(isValidDate(toString($date_closed)),ifElse(isBefore($date_closed,date(toString(01/07/2021))),false,true),true) : attempt to convert invalid value to date: Thu, 01 Jul 2021 02:47:36 +0000'

Any idea how I can prevent this error please?

Any help appreciated

Many thanks