NL17SZ74 D-Flip Flop circuit doesn't work!
You're operating the device outside its RECOMMENDED OPERATING CONDITIONS.  Of course you're free to do that but this can lead to unspecified behavior.
In your case the &quot;Input Rise and Fall Time&quot; specification is being exceeded.  For 5V operation the specification is 5 ns/V MAX.  So you need to ensure that your CP input rises from 0 to (0.7 * Vcc) in (0.7 *5V) * 5 ns/V = 17.5 nS.
Your CP rising edge is WAY WAY slower than that.  Adjust the R and C values to give you a more reasonable TC (time constant) and you should see it behave better.