When near the end of the world (30,000,000 blocks) you cannot place pistons and command blocks upwards or downwards at certain x and z values in a chunk. Instead they will always turn sideways.
Affected coordinates in a chunk:
The screenshot shows the result of trying to place pistons facing upwards. The lapis lazuli blocks mark the 0,0 corner; the redstone blocks mark the 15,15 corner.