Just because the circuit seems to work in simulation, doesn't mean that it works in reality. Check the current that is flowing through the base of the transistor when the PWM input is high. That amount of current would surely destroy a transistor in the real world.
What you're seeing is the base-collector capacitance dragging the collector below ground when the base voltage starts dropping.
First you need to add a resistor between the PWM source and base and calculate it so it doesn't saturate the transistor too much. You might try adding a
Baker clamp to further improve the result.