Must be some broken compilers out there recently? I've been seeing this sort of issue with the recent release of Lazarus, but I am still at Lazarus 3.4, and I just tested that code and works just fine here with Lazarus 3.4-Fpc 3.2.2
If you wrap the expression with a Byte, that should also work but really, turning off the Range check in mid-stream should also work. It works here, but obviously not there. I am on Windows.