So i only tested the code on a suitelet, i didn't ...
# suitescript
d
So i only tested the code on a suitelet, i didn't try on a restlet yet, it should work the same though. Can you wrap in a try/catch and check the error reported