Since you are already telling it how to interpret the dates with the SET statement, perhaps just try using the date() format function vs the date#() which is an interpreter. Otherwise I'd say try nesting the date#() function inside of the date() function.
From a technical brief posted on the community... "It is often practical to nest an interpretation function inside a formatting function, e.g.
Date( Date#( DateField, 'M/D/YY'), 'YYYY-MM-DD') as Date
The inner function ensures that the input text is interpreted correctly – so that a serial
number representing the date is created. The outer function ensures that the serial number