Merely stating it doesn’t work w/o describing exactly what happened doesn’t help.
And btW, we just use updatePixels() and/or loadPixels() for pixels[].
Methods beginDraw() & endDraw() shouldn’t be used on that context.
And given you’re createGraphics() every time rather than using an existing 1 you can instead clone a PGraphics as a PImage calling method get():