Grey border around object when using 'Smooth Mask'

Hi everyone,
With my current project I’m compositing an object into some tracked footage. The problem is that when I use the ID mask node with ‘Smooth Mask’ enabled, the object will have a grey border around the object which increases with thickness as the object gets further away from the camera.

But if I don’t use smooth masking, then the object edges will be more aliased the closer it is to the camera :frowning: I’ve attached 2 frames from the footage with smooth mask enabled for clarification.