I guess this is always true, if you adjust the statement appropriately.
Consider the Bott–Chern cohomology $H^*_{BC}(M):=\dfrac{\ker d\cap \ker d^c}{\operatorname{im} dd^c}$. Since the curvature of a line bundle is a closed $(1,1)$-form, its Chern class can be considered as an element of the Bott–Chern cohomology. There are natural maps from $H^{1,1}_{BC}$ to the Dolbeault cohomology and to de Rham cohomology; the de Rham image of the curvature is $c_1(L)$, and the Dolbeault image is the cohomology class of $\bar\partial \partial\log\lvert f\rvert$, which is equal to the Dolbeault representative of the Atiyah class.
This is also seen from the commutative square that Atiyah writes
$$\require{AMScd}\begin{CD} H^1(O^*_M) @>>> H^2(M,{\Bbb Z}) \\ @VVV @VVV \\ H^1(\Omega^1_M) @>>> H^2(M,{\Bbb C}) \end{CD}$$
which is valid in general situation, non-compact or non-Kähler as well.