I glanced at the source, and I saw you used the standard Adafruit ST7789 library.
1) You probably don't have to have enough memory in your Teensy to support 5 screens. It may be the Adafruit library fails when you try to allocate enough memory for each screen. The standard Adafruit ST7789 does not appear to be able to override where the screen buffer is. The Teensy specific ST7789_t3 library does have a setFrameBuffer function where you can override whether you use a frame buffer, and where it is.
Lets see. The Teensy 4.0 and 4.1 have 1 megabyte of memory, but it is divided into 2 banks of 512 kilobytes each. Memory allocations only come from one bank, while the program, static/global variables, and the stack use the other bank. You are using a 240*320 display, which means each display needs 153,600 bytes, or 150 kilobytes. Thus, you will likely not have enough memory for the 3rd display, given other parts of the system may allocate other things that eat into that 512 kilobyte area.
If you have a Teensy 4.1 there are 2 areas under the Teensy that you can solder either 1 PSRam chip, 2 PSRam chips, or 1 PSRam chip and a non-volatile flash memory chip using surface mount soldering. Each PSRam chip is 8 megabytes, and they act as normal memory. Now, the memory in the PSRam chip is slower than the normal memory, but it should still be usable for display memory. The flash chips are non-volatile, and typically they are used like you would use a micro-SD card. AFAIK, you can get flash chips up to 256 megabytes.
If your soldering skills are not up to doing SMT soldering, you can order a Teensy with PSRam and/or flash memory chips soldered on at:
protosupplies.com. In the past, I've done SMT soldering, but it getting harder these days, and I typically go the protosupplies.com route.
Assuming you have at least 1 PSRam chip, you should be able to statically allocate the buffers via:
Code:
const size_t SCREEN_SIZE = 240*320;
EXTMEM uint16_t buffer1[SCREEN_SIZE]; // each buffer takes, 153,600 bytes
EXTMEM uint16_t buffer2[SCREEN_SIZE];
EXTMEM uint16_t buffer3[SCREEN_SIZE];
EXTMEM uint16_t buffer4[SCREEN_SIZE];
EXTMEM uint16_t buffer5[SCREEN_SIZE];
2) Even if you have enough memory because you used a smaller display, it may be there are hidden limits in the Adafruit library, and perhaps switching to the ST7789_t3 library might fix those. But as I said in #1, I suspect you are running out of memory.
3) On a Teensy 4.1, you can attach displays to different SPI buses. There are 2 SPI buses that are normally available. There is a 3rd SPI within the SD card support, and a 4th SPI bus for the attached memory. Perhaps having 3 displays per memory bus will work better than 5.
4) When you have to have more than one display on a SPI bus, there are things that you might need to do for the displays not to interfere with each other. See
Display & SPI optimization by the Teensy creator Paul S. In particular, you might need pull-up or pull-down resistors for the CS pin (it depends on whether the display wants the CS pin high or low to activate it).