The authors of Roul et al. (J Math Chem 61:2146–2175, 2023) developed a numerical method for the time-fractional diffusion equation. In this method, the L1 scheme is employed on a uniform mesh for time discretization and a compact finite difference scheme for spatial discretization. They have ignored the initial weak singularity at \(t=0\) . The present study applies the \(L2\text {-}1_{\sigma }\) scheme on a graded temporal mesh, providing an improvement over the L1 scheme by accurately approximating the Caputo time-fractional derivative and capturing the initial-time singularity. Spatial derivatives are approximated using a high-order compact finite difference scheme. The stability and convergence of the proposed scheme are rigorously proven using the energy method, in contrast to the Von-Neumann analysis used in Roul et al. (J Math Chem 61:2146–2175, 2023), which is limited to periodic and homogeneous boundary conditions. The proposed scheme achieves a temporal accuracy of \(\min \{r\alpha ,\,2\}\) , with \(\alpha \in (0,1)\) , and fourth-order spatial accuracy. Numerical experiments validate the theoretical findings, and comparisons with Roul et al. (J Math Chem 61:2146–2175, 2023) and Roul (J Comput Appl Math 451:116033,2024) demonstrate the superior accuracy of the proposed approach.