That's surprising that you are using a Raspberry pi.Good work!
Hi! By simulating your flip flop design with SPICE (and implementing it on a breadboard), I came to believe that it's not positive-edge triggered, but rather dual-edge triggered.