Illegal memory access when executing cufftExecD2Z in cuFFT library

I really appreciate it if anyone can help me with this.

The code presented in the above question is inside a function that is called by the main function. Further, the same length cufftExecD2Z transform is also used in a different function but that didn’t throw any error.