Code runs fine from Thonny, but not as main.py

If I don’t I run out of memory. On a Pico anyway.
Trying to run dual independent displays on a Pi PICO - Support - Pimoroni Buccaneers
Pico Display Pack V2 x 2? · Issue #299 · pimoroni/pimoroni-pico (github.com)