alterDock takes a dockID as a required parameter. Are your docks the same ID and only 1 is being affected? If this is your case, I would create 3 unique dockIDs and call the function 3 times.
ex.
dockConfig = {}
system.perspective.alterDock(leftDock, dockConfig)
system.perspective.alterDock(rightDock, dockConfig)
system.perspective.alterDock(topDock, dockConfig)