What version of MODx? Can you change the template in the Manager? Are those legitimate template IDs?
BTW, you should use this to set the content:
$resource-setContent($newContent);
I’ll remember the thing with the content.
And yes i can change template in manager. I’m on version 2.0.4. Well 1 is a legitimate template id but i wan’t to assign no template to the resource and tried with 0 and null. If i assign no template in the manager 0 is the value passed.
I believe that was a bug with template saving, so you might try upgrading to 2.0.8.