There is no way "grid[1*tilesY*tilesX + 0*tilesX + 0]" will show tile on 7th row, unless your rendering code is broken.
Just draw the memory layout on paper.
So tilesY = 2, tilesX = 3, number of screens = 2.
What is tile on first column (x=0), first row (y=0) of second screen (s=1)? It is tile G.
(s*tilesY*tilesX + y*tilesX + x) = (s*2*3 + y*3 + x) = (1*6 + 0*3 + 0) = 6
How array is layed out it memory?
| A B C D E F G H I J K L
\-+-/ \-+-/ \-+-/ \-+-/
| | | |
| | | +-- second row ----\
| | | +---- second screen
| | + ------- first row ----/
| |
| +-------------- second row ----\
| +---- first screen
+-------------------- first row ----/
|
What is character at index=6 ?
| ABCDEFGHIJKL
012345678901
|
It is "G"!
Try plugging different values in this equation and see how it works. Step through code that fills grid array and see what index it access for every iteration. And draw everything on paper (just use smaller values for tilesX and tilesY variables instead of 17x9).