(I apologize for yelling, but …)
DO WE NEED TO POUND YOUR HEAD WITH A HAMMER . . . WE KEEP TELLING YOU IT IS:
this.command(peasant, “buildXY”, “palisade”, X, Y);
it is build X Y NOT build position NOT build string
By the way, position aren’t strings either, they are dictionary/objects and are created as vettax said:
targetPos = {x: 50, y: 50};
If you try it directly with a string (which you should have done before trying to build one):
this.command(peas, "buildXY","palisade", "50,50");
you get an error!! NO amount of string building is going to fix what a straight string can’t do.
If you try a proper position it will give you the SAME ERROR:
this.command(peasant, "buildXY", "palisade", {x: 50, y: 50});
It wants an X, Y coordinate. Once again because it is: buildXY
Since you refuse to believe us maybe you will believe the guild:

this.command(peasant, “buildXY”, “palisade”, 50, 50);
You find that you get NO error, because finally you did your part right.
(Your peasant may walk to the spot and build nothing. I’ve only tried on a couple of levels but haven’t got one to build stuff outside of Misty Island Mine, myself.)
(Again, I apologize for yelling.)