Touchpad sometimes shuts down the laptop

Are you sure it’s caused by the touchpad, or maybe it just so happened that you were using the touchpad at that moment? Was the shutdown graceful or completely sudden like pulling out the plug?

In the latter case I can suggest you the following thread: