Why does M4 turn off and Vout be equal to zero?
As the gate of M4 (which is a PMOS) is \$V_{DD}\$, the only way to make M4 turn on is the take the bulk or drain or source connection of M4 at least \$V_t\$ above \$V_{DD}\$. So we would need \$V_{DD} + V_t\$ to be present somewhere in the circuit.

This can only happen if capacitor \$C_B\$ is first charged (with \$V_A\$ = GND and \$V_B\$ = \$V_{DD}\$) and then discharged by making \$V_A = V_{DD}\$ then there would for a short time be \$2*V_{DD}\$ present at \$V_B\$. But as \$C_B\$ discharges through M5, which is on, see Andy's answer, so the \$V_{GS}\$ of M4 must be zero, hence it is off.