Excluding the sky from the outline shader results in thinner lines

Hello, there!

I followed the Cel shading tutorial posted on the Unreal Engine channel a few years back. The outlines resulting from that method also affect the sky, so I used custom depth to exclude the sky from the shader.
However it seems that in doing so, the outlines become thinner where objects intersect with the sky. Going through Google and Youtube, it seems none of the other tutorials have a way of stopping that from happening.

I also tried to check for distance from camera, but the result is the same.

Does anyone have an idea of how to stop this from happening?