You can try to skip this sometimes, but are explicitly warned against it in the reference:
Certain renderers may or may not seem to require loadPixels() or updatePixels() . However, the rule is that any time you want to manipulate the pixels array, you must have previously called loadPixels() , and after changes have been made, call updatePixels() . Even if the renderer may not seem to use this function in the current Processing release, this will always be subject to change.
I didn’t look at the source, but it could be that Processing automatically calls beginDraw and endDraw for the default g PGraphics at the begining and end of draw(). Maybe that means you can’t draw g onto something else because endDraw hasn’t been called yet?
Knowing why you want to do this may help suggest an alternative
I don’t want to use loadPixels on the main graphics cause it can be really slow depending on it’s size.
So what I do now is make a smaller graphics, then I draw g on that smaller graphics and load the pixels from that instead. I can only get this working in post which is not safe to draw, but it works…
Here is the repository if anyone is interested. If you made something cool then please post a image.