Z-combine artifacts

Hello, I’ve a very stupid problem with the z-combine node in blender node system (Cycles).

Basically, I have 2 render layers: a background and a sort of hexagon-shaped hollow. I would like to use Z-combine, not Alpha.

The layers are fine, but after z-combining I get ugly outline in the overlay region.

How could I fix it?

Good morning, @scarafaz! So, you may be struggling with the limited sampling used for a Z pass. If you read about data passes in the manual, it recommends using the Mist pass. Maybe try that one instead?

Manual page for your reference:
https://docs.blender.org/manual/en/4.0/render/layers/passes.html#data