A time-fractional diffusion equation with an interface problem caused by discontinuous coefficients is considered. To solve it, in the temporal direction Alikhanov’s $L2-1_σ$ method with graded mesh is presented to deal with the weak singularity at $t = 0,$ while in the spatial direction a finite element method with uniform mesh is employed to handle the discontinuous coefficients. Then, with the help of discrete fractional Grönwall inequality and the robustness theory of $α → 1^−,$ we show that the method has stable error bounds at $α → 1^−,$ the fully discrete schemes $L^2(Ω)$ norm and $H^1(Ω)$ semi-norm are unconditionally stable, and the optimal convergence order is $\mathscr{O}(h^2 + N^{−{\rm min}\{rα,2\}})$ and $\mathscr{O}(h + N^{−{\rm min}\{rα,2\}}),$ respectively, where, $h,$ $N,$ $α,$ $r$ is the total number of spatial parameter, the time-fractional order coefficient, and the time grid constant. Finally, three numerical examples are provided to illustrate our theoretical results.