The only possibility I am coming up with is that you redefined sin() or cos() as functions, or that integrand_separable2 is defined within a nested scope that defines sin() or cos() as variables.
I suggest that at the command line, you invoke
dbstop if error
dbstop if caught error
and then run again; when it stops, examines everything carefully.