Trying to do a desaturation pass on background

As the collegue above mentioned, there are easier ways… And to be honest, I wonder why you choose this one. Well, if you need a composer for some reason, then you can use approach when you use a mask and passes. You render mask where the hovered (or something what you need) objects are white and the rest are black. Then you pass the color scene and then count the desaturation in the shader with the mask: if the pixel in the mask is black, you give it grayscale, if white, it remains colored.

https://codepen.io/editor/Lucas_Mes/pen/019d2f03-d540-7213-9b4c-805045953679