When you assign a new mode to a display, it actually creates a new display object of a different type, which you can then retrieve through another
display(n) call. But if you've previously grabbed a reference to the old display object, you still have that reference to the old display object, not the new one.
This lets you do things like off-screen drawing (e.g. grab a reference to a PixelDisplay, then switch that display to something else while you do your drawing, and then switch it back for display). But it also means that your first code above doesn't work, because your
tileDisp reference is not a tile display, but is whatever
display(5) was before (probably a PixelDisplay).
We attempted to document this on the wiki page for Display.mode, but I know it's a bit of a tricky thing — if you have any suggestions on how to make this more clear, please share! 🙂