Electric vehicle (EV)-related risk and uncertainty pose critical challenges for urban traffic management. Fine-grained crash risk prediction at 1 km × 1 km and hour-of-day resolution remains difficult due to rapidly evolving, strongly spatiotemporally heterogeneous crash patterns. Crash risk research spans risk measurement, prediction modeling, and factor selection, with a move toward interpretable nonlinear hybrid methods, yet temporal dynamics and local heterogeneity remain insufficiently modeled. This study addresses these limitations by first constructing a Spatio-Temporal Adaptive Network Kernel Density Estimation (ST-ANKDE) method that combines network-constrained proximity, cyclic time weighting, severity weighting, and adaptive bandwidths, and then developing a Multiscale Geographically and Temporally Weighted Regression-Extreme Gradient Boosting (MGTWR-XGBoost) method to learn local heterogeneity and nonlinear effects. To capture the influence of preceding periods and adjacent grids, we introduce temporal and spatial weighted crash risk variables (T-AccRisk and S-AccRisk). These are analyzed alongside road-network density, built-environment variables, socioeconomic variables, and EV-specific infrastructure variables. An empirical case study on 14,818 EV crashes shows that ST-ANKDE effectively captures crash risk dynamics, with a mean value of 6.57, and reveals pronounced spatiotemporal heterogeneity. The results show that MGTWR-XGBoost, enhanced by S-AccRisk and T-AccRisk to capture spatiotemporal dependence, achieves MAE = 1.54 and RMSE = 2.06 and outperforms standalone machine learning and other hybrid methods; road-network density, built-environment features, population density, and EV infrastructure coefficients exhibit significant spatiotemporal heterogeneity. Moreover, SHapley Additive exPlanations (SHAP) further analyzes nonlinear effects. These findings enable grid-level early warning, priority targeting of high-risk periods/locations, and data-driven deployment of enforcement and infrastructure for EV safety management.