Magic VLSI D flipflop with IRSIM
Don't try to change the data input and the clock at the same time. You are violating the setup and/or hold time of your latch. Try changing the clock value about half-way between edges of the data input.

By the way, what you have is a level-sensitive bistable element, which I refer to as a latch. I reserve the word "flip-flop" for edge-sensitive elements.