You have supplied an argument to an intrinsic function which is of the wrong format, for example INTEGER-OF-DAY requires a date of a certain format.
Check the format of your argument against the documentation and recode.