I want to do a 2D fit using a self-made Gaussian pdf (myRooGaussian1stbin) which is normalized in the fitting range. But with free any of the parameters, this pdf value is pushed to nan (below).

p.d.f value is Not-a-Number (-nan), forcing value to zero @ x=pi0_m_prefit=0.1788, a_mu=a_mu=-0.873702, b_mu=b_mu=1.02511, c_mu=c_mu=3.36042e+08, d_mu=d_mu=4197.5, p0_sigma=p0_sigma=-nan, p1_sigma=p1_sigma=-nan, y=pi0_errm=0.00993388

You should check that both the pdf un-normalized value is not zero and also that its integral is not zero. If they are this will cause a NaN when evaluating the pdf

Yes, I have checked this with a free parameter of sigma but pdf un-normalized value (value) and its integral (norm) both are also pushed to nan.
I donâ€™t understand why this happens.