Hmm.. I was wondering about this, since the getTerrainData() function should work properly. But I found the issue in this case, "ChunkUtils:getChunkAndBlockPosition()" does not return the expected block position: The x, y and z values of the blockposition have an offset of two (it has technical reasons, since we use this function internally too). I already changed this (the fix will be available with the next update). In the meantime, you could subtract the value "2" from the blockposition as a workaround, like this:
[lua]local terrainId = world:getTerrainData(chunkPos.x, chunkPos.y, chunkPos.z, blockPos.x - 2, blockPos.y - 2, blockPos.z - 2);[/lua]