It could just be that an intermediate variable isn't being used:
...may work from the interactive parser but won't necessarily work in a script. I've seen similar behaviour in the other code I've written so I'm always in the habit of breaking up the operation as Lawrence showed.
Aside: You may need to follow the 'ddDeleteObj(cell)' with a 'ddReleaseObj(cell)'. In general, matching 'myVar=ddGetObj(...)' with 'ddReleaseObj(myVar)' makes life a lot easier when you start doing more complex creation/editing of database-linked objects like 'verilog.v' or 'expand.cfg' files.