I have a rigged and animated character that looks completely fine in blender (original .blend file). When I export it, the mesh gets distorted in some places. It looks like some of the vertices are weighted incorrectly. For gltf files, some of the bones change its scale and rotation, in fbx the bone arrangement look different too. Collada looks ok. But the distortion still happens during animation - when the bones are not in its orginal position.
I applied tranforms to the armature like a million times and it didn't help (cleared parent, applied transforms - ctrl A - to the mesh and armature and reparented back with different options, no effect).
I also tried normalizing bone weights, checking normals, baking the animation, I made different animation tracks... Nothing helped. The mesh looks ok only with bones in its rest position.
Any suggestions? I can't find any solution to this and I'm really desperate as I exported this particular mesh multiple times with no issues and then it started to do weird things after I removed the subdivision modifier (not applied, removed).
I'm still pretty new to blender so I may be missing something... Thank you for any help
Here are some pictures demonstrating the problem. How it should look like vs how the exported .gltf looks like.