Please see http://pubs.opengroup.org/onlinepubs/9699919799/functions/exit.html:
The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, [CX] or any other value, though only the least significant 8 bits (that is, status & 0377) shall be available to a waiting parent process.
The unix exit status only has 8 bit. 256 overflows so I guess the behavior in that case is simply undefined. For example this happens on Mac OS 10.7.3 with Ruby 1.9.3:
irb(main):008:0> `sh -c 'exit 0'`; $?
=> #<Process::Status: pid 64430 exit 0>
irb(main):009:0> `sh -c 'exit 1'`; $?
=> #<Process::Status: pid 64431 exit 1>
irb(main):010:0> `sh -c 'exit 2'`; $?
=> #<Process::Status: pid 64432 exit 2>
irb(main):011:0> `sh -c 'exit 255'`; $?
=> #<Process::Status: pid 64433 exit 255>
irb(main):012:0> `sh -c 'exit 256'`; $?
=> #<Process::Status: pid 64434 exit 0>
Which is consistent with what my shell indicates
$ sh -c 'exit 256'; echo $?
0
$ sh -c 'exit 257'; echo $?
1
I'd propose you fix the shell-script (if possible) to return only values < 256.