Direction of Arrival (DOA) estimation is essential in building the wireless electromagnetic (EM) environment. However, the conventional DOA estimation methods have been criticized for their hardware complexity, high cost, and low energy efficiency. Recently, metasurface-based methods have emerged as promising alternatives that offer cost-effective solutions. Nevertheless, the existing studies have neglected angle sensitivity, an intrinsic physical property of metasurface, leading to errors in DOA estimations. To address this issue, we propose a generalized high-precision and wide-angle DOA estimation method based on the space-time-coding digital metasurfaces (STCDM). By carefully designing two elementary STC sequences, we realize two angle-independent harmonic states to construct a specified orthogonal matrix. Then, the harmonics, modulated by each meta-column in accordance with the matrix, are sampled by a single channel receiver at different time intervals. Upon the reception of the signal, the information on the metasurface can be comprehensively retrieved through the matrix operations, facilitating the high-accuracy DOA estimations using the array signal processing (ASP) algorithms. This work focuses on eliminating the influence of angle sensitivity on the metasurface-based DOA estimations, which guarantees high accuracy and substantially reduces hardware requirements. The proposed method holds potential for various applications, including Internet of Things (IoT) and integrated sensing and communication (ISAC).