Despite weights being painted correctly, mesh moves in weird ways when I try to animate bones
You have overlapping vertices, so go in Edit mode and merge by distance. You'll maybe have some corrections to do though.