I don’t see where you are resizing your sketch. You are resizing your image, which you are doing in draw()
which is probly not a good idea but this is not causing this error.
What you need to do is to run a simple sketch using the P3D renderer and see if you can reproduce the problem. Remove the statement surface.setResizable(true);
and see if that line is the culprit. For this, you should consider writing and MCVE that reproduces the error. Don’t forget to comment about your OS, Processing version and also talk about your graphics card. With an mcve, people having machines like yours could test your code and verify if they can reproduce the effect.
Kf