I’m trying to simulate a NAND gate using MOSFETs in QUCS, but I’m having trouble getting it to work. Could someone help me figure out what’s going wrong?

All the resistors are set to 1 kΩ, the supply voltage is 1 V, and the square wave generator has a period of 1 ms and 2 ms with a 10 ns switching time. When I draw the same circuit in Voltsim on my phone, it works as expected.