Jagged edges in toon shading attempt

Lately I’ve been trying to achieve a good toon shading look in blender, trying to replicate what this guy did:

The problem is I get some jagged edges in the shadows and an overall weirdness

I uploaded an image of my node setup in the compositor.

toon shading trial .blend (549 KB)

I attached the blend file.