I just tried my script again with a different sid (testdb) and that worked fine.
But when I try it with a sid such as "s0839482", I get the errors.
Does it have something to do with the name? Can a sid name consist of numbers?