its not actually the commander itself, you have to move closer to where your building (not right next to it, but within its radius) to build from a distance
move your commander to an appropriate radius before you start building.
ALSO, there might also be debrie from the commander explosion which may have landed ontop of the mex point or an area which you want to build, hence the extraction range is much smaller than the build range, so thats why it walks up and extracts what ever is there first, then builds the building
hope that helps mate!