I’ve figured out one way to do it, but it’s not terribly elegant. First turn the clip black and white, then use the Chroma Keyer to replace the black with the gradient you want underneath the black. Render that out as a file. Then change the gradient for the one you want underneath the white and change the Key colour to white. Render that out as a file. There’s now one file that’s black and rainbow, and one that’s white and rainbow. Load both back in, layer them on top of each other, and use the Chroma Keyer to make the non-rainbow colour of the top clip transparent.
It’s doable like that, but I can’t help but think there’s a more elegant solution somewhere.