When no buffer was supplied it would fall upon the class to call "new" and allocate within C/C++'s (very small) heap.
Ensure a MicroPython managed buffer (allocated from gc_heap) is always supplied to the APA102/WS2812 classes.
A bytearray allocated in Python would point to uninitialised bytes, missing the SOF byte and brightness for APA102 pixels.
Add a blunt loop over the MicroPython buffer, calling "brightness" for each RGB element to ensure the SOF byte and brightness are initialized.