Old, old thread, I know. But I spent some hours with the same problem and finally found the solution, so in case someone finds this thread by searching...
The error with partedUtil setptbl resulting in SetPtableGpt: Unable to commit to disk is "simple": setptbl seems to require to specify the ENTIRE partition layout, so all existing partitions with all their starting end ending sectors etc., plus the one you want to create.
But, luckily, that is not necessary if you just need to add a partition at the end (or probably also in between, if there's space). Just use partedUtil add instead and it should work!