I am not sure you can be sent to jail simply for creating something that turns out to be a bad investment. (goes to 0) This is true even in the arguably more regulated stock market.
That being said it seems like there is more to his story than buggy code.