I know what it is. Are you posting in rapid succesion and thereby violating the default time interval between posts?
Just after your sets and before you save put this. It's what I do in Articlebot.
PHP Code:
$newThread->registry->options['floodchecktime'] = 0;
Also, I believe you should also have the $newThread->pre_save() bit in there as that runs many functions needed for a thread.