Why is my spline deforming the mesh when it's applied to the chain?

The spline itself seems fine, it’s just that it deforms the mesh when applied to the bones. I made the skeletal mesh in Blender. After importing into UE I used a basic FK control rig at first and it worked, but I switched to spline because I needed smoother animation. This is the first time I’ve ever worked with manual rigging.

First image is before applying, showing that the spline is working. The second is after applying it to the bones. It looks like it’s rotating the mesh on the Y axis or something.

I used Epic’s guide Control Rig Spline Rigging in Unreal Engine | Unreal Engine 5.7 Documentation | Epic Developer Community

EDIT:

After testing a lot I don’t think it’s the export from Blender. I’ve verified the mesh and armature are oriented the same way before export and I’m using +X Forward and +Z Up (and tested every other variety).

I’ve tried changing the rotation on import but that affects both armature and mesh of course which isn’t what I want. It’s almost like the individual bones get rotated?

For some reason the control handles default to vertical as shown in the image below. I don’t know if this is indicative of a problem (seems weird). I can change the handle rotation but it doesn’t solve anything.

When I do a simple FK rig it seems to work fine (another image below).

Oh my god I finally got it working. It was the Bone axis settings in Blender export.

Primary Bone Axis: X

Secondary Bone Axis: -Y

Here are all the export settings I used.