What's the error in this simulated amplifier circuit?
You have a Zener diode where you should have a current regulator (shown as an arrow inside a circle). As a result the upper output transistor cannot pull up to the supply voltage, so the output waveform has low amplitude and is distorted.

Try replacing the Zener with a current mirror set to about 4mA, like this:-



(the LM386 probably uses a FET to create a constant current source, but the circuit above should be close enough for working at 5V). 

Response to edit: 

Now that you have changed the Zener to a current source, the circuit is doing what it should! The 'stepped' output is simply due to over-driving the amplifier. With 400mV input and gain =20 it wants to output 8V, but only 5V is available so it hits the supply rails first.