Two possible problems here. First, you may be using the WiringPi numbering scheme and Mathematica expects the BCM number. Second, the documentation does not state that GPIO 27 is accessible (it was not available in the early Pi versions and I do not believe the driver has been updated).
A workaround is to avoid the Device* commands all together and to use RunProcess
with the gpio utility, which is probably available on your RPi but can be found at Gordon's WiringPi website, for example:
RunProcess[{"gpio","mode","27","out"}]
RunProcess[{"gpio","write","27","1"}]
RunProcess[{"gpio","read","27"}]
Faster performance can be obtained by executing a shell and writing/reading to the stream. See the RunProcess documentation for further help on that approach.