How to REorganise colour by gradients?

So I’ve combined two colour palettes which had some gradient ranges. All the colours are jumbled and the gradients seem to be all over the place. “Sort by Hue” is the option which brings it the closest but it’s still not in the original gradients. Also what often happens is that I rearrange colours for the purpose of hues etc. so I lose the original gradient layout.

Is there a solution?

There is no automatic way to do this, you’d have to rearrange them manually. Go with “sort by hue” and go from there.