Run DDL in procedure like this way is possible, i suspect some role related problems? Try set role none or all separately, and then run test the code.

Take care